Re: [Piglit] [PATCH 2/2] framework: Make driver_classifier convert to str (unicode)

2016-09-17 Thread Eric Anholt
Dylan Baker  writes:

> In python2 the code as is works, although there might be odd corners. In
> python 3 it fails because the code tries to match bytes and strs, which
> doesn't work at all.
>
> This patch fixes the issue by converting the output from bytes to str
> (unicode) immediately, so we don't have to think about it again.
>
> CC: Eric Anholt 
> Reported-by: Dan Kegel 
> Signed-off-by: Dylan Baker 

I see you've pushed, but I wanted to say thanks for taking care of this!


signature.asc
Description: PGP signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] framework: Make driver_classifier convert to str (unicode)

2016-09-16 Thread Dylan Baker
In python2 the code as is works, although there might be odd corners. In
python 3 it fails because the code tries to match bytes and strs, which
doesn't work at all.

This patch fixes the issue by converting the output from bytes to str
(unicode) immediately, so we don't have to think about it again.

CC: Eric Anholt 
Reported-by: Dan Kegel 
Signed-off-by: Dylan Baker 
---
 framework/driver_classifier.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/driver_classifier.py b/framework/driver_classifier.py
index c63b88d..dcef6cd 100644
--- a/framework/driver_classifier.py
+++ b/framework/driver_classifier.py
@@ -55,8 +55,8 @@ class DriverClassifier(object):
 """
 
 try:
-output = subprocess.check_output(['glxinfo'],
- stderr=subprocess.STDOUT)
+output = subprocess.check_output(
+['glxinfo'], stderr=subprocess.STDOUT).decode('utf-8')
 except OSError as e:
 if e.errno not in [errno.ENOENT, errno.EACCES]:
 raise
-- 
2.9.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit