[jhbuild/wip/lantw/sysid-decode-the-output-of-check_output] sysid:	decode the output of check_output
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [jhbuild/wip/lantw/sysid-decode-the-output-of-check_output] sysid:	decode the output of check_output
- Date: Tue, 24 Sep 2019 08:43:30 +0000 (UTC)
commit 17c87617397c5f0692c953f44136a3ff9b87ccb2
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Tue Sep 24 16:39:36 2019 +0800
    sysid: decode the output of check_output
    
    Otherwise, JHBuild just crashes immediately on FreeBSD because of mixing
    str and bytes in an expression.
 jhbuild/utils/sysid.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/jhbuild/utils/sysid.py b/jhbuild/utils/sysid.py
index fc4390fe..5ed5cea1 100644
--- a/jhbuild/utils/sysid.py
+++ b/jhbuild/utils/sysid.py
@@ -21,6 +21,8 @@ import sys
 import subprocess
 import ast
 
+from . import udecode
+
 sys_id = None
 sys_name = None
 default_conditions = None
@@ -84,7 +86,7 @@ def get_macos_info():
     global sys_id
 
     try:
-        ver = subprocess.check_output('sw_vers -productVersion')
+        ver = udecode(subprocess.check_output('sw_vers -productVersion'))
 
         sys_name = 'Mac OS X ' + ver
         sys_id = 'macos-' + ver
@@ -99,7 +101,7 @@ def get_freebsd_info():
     global sys_id
 
     try:
-        ver = subprocess.check_output('freebsd-version').strip()
+        ver = udecode(subprocess.check_output('freebsd-version')).strip()
 
         sys_name = 'FreeBSD ' + ver
         return True
@@ -107,7 +109,7 @@ def get_freebsd_info():
         pass
 
     try:
-        ver = subprocess.check_output(['uname', '-r']).strip()
+        ver = udecode(subprocess.check_output(['uname', '-r'])).strip()
 
         sys_name = 'FreeBSD ' + ver
         return True
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]