[Patchew-devel] [PATCH 2/2] www: Call subprocess compatibly with python34

Fam Zheng posted 2 patches 6 years, 1 month ago
[Patchew-devel] [PATCH 2/2] www: Call subprocess compatibly with python34
Posted by Fam Zheng 6 years, 1 month ago
encoding parameter is not supported until python 3.6.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 www/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/views.py b/www/views.py
index 1648754..e12fa48 100644
--- a/www/views.py
+++ b/www/views.py
@@ -23,8 +23,8 @@ PAGE_SIZE = 50
 
 def try_get_git_head():
     try:
-        return "-" + subprocess.check_output(["git", "rev-parse", "--short", "HEAD"],
-                                             encoding='utf-8')
+        return "-" + subprocess.check_output(["git", "rev-parse",
+                                              "--short", "HEAD"]).decode()
     except:
         return ""
 
-- 
2.14.3

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel