[Piglit] [PATCH 35/44] framework/core.py: make collect_system_info return unicode

baker.dylan.c at gmail.com baker.dylan.c at gmail.com
Wed Jan 27 16:06:43 PST 2016


From: Dylan Baker <baker.dylan.c at gmail.com>

This changes collect_system_info to convert the raw output of each
command to unicode before returning it.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/core.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index 5ef72cb..3906b58 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -154,8 +154,8 @@ def collect_system_info():
 
     for name, command in progs:
         try:
-            result[name] = subprocess.check_output(command,
-                                                   stderr=subprocess.STDOUT)
+            out = subprocess.check_output(command, stderr=subprocess.STDOUT)
+            result[name] = out.decode('utf-8')
         except OSError as e:
             # If we get the 'no file or directory' error then pass, that means
             # that the binary isn't installed or isn't relavent to the system.
-- 
2.7.0



More information about the Piglit mailing list