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

Fam Zheng famz at redhat.com
Fri Mar 16 03:50:13 UTC 2018


encoding parameter is not supported until python 3.6.

Signed-off-by: Fam Zheng <famz at 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




More information about the Patchew-devel mailing list