[Piglit] [PATCH 1/2] framework: Write exceptions and traceback to /dev/stderr.
Jose Fonseca
jfonseca at vmware.com
Tue Dec 8 08:14:21 PST 2015
---
framework/test/base.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/framework/test/base.py b/framework/test/base.py
index bf998d8..378f185 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -184,11 +184,12 @@ class Test(object):
# This is a rare case where a bare exception is okay, since we're
# using it to log exceptions
except:
- exception = sys.exc_info()
+ exc_type, exc_value, exc_traceback = sys.exc_info()
+ traceback.print_exc(file=sys.stderr)
self.result.result = 'fail'
- self.result.exception = "{}{}".format(*exception[:2])
+ self.result.exception = "{}{}".format(exc_type, exc_value)
self.result.traceback = "".join(
- traceback.format_tb(exception[2]))
+ traceback.format_tb(exc_traceback))
log.log(self.result.result)
else:
--
2.5.0
More information about the Piglit
mailing list