[Piglit] [PATCH 08/20] framework: Catch "No such file or directory" by errno, not strerr.

Jon Severinsson jon at severinsson.net
Fri Apr 12 16:39:50 PDT 2013


In Python 3.x the strerr is more verbose, and thus fails the equals test.
---
 framework/exectest.py |    3 ++-
 1 fil ändrad, 2 tillägg(+), 1 borttagning(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index 2e20e7d..2386e80 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -22,6 +22,7 @@
 
 from __future__ import unicode_literals
 
+import errno
 import os
 import subprocess
 import shlex
@@ -208,7 +209,7 @@ class ExecTest(Test):
 			# a developer chooses to not build a test,
 			# Piglit should not report that test as having
 			# failed.
-			if e.strerror == "No such file or directory":
+			if e.errno == errno.ENOENT:
 				out = "PIGLIT: {'result': 'skip'}\n" \
 				    + "Test executable not found.\n"
 				err = ""
-- 
1.7.10.4



More information about the Piglit mailing list