[Piglit] [PATCH 02/20] framework: Consistently use Python 2.6+ syntax for exception objects.
Jon Severinsson
jon at severinsson.net
Fri Apr 12 16:39:44 PDT 2013
The old syntax is no longer supported in Python 3.x.
---
framework/core.py | 4 ++--
framework/junit.py | 4 ++--
2 filer ändrade, 4 tillägg(+), 4 borttagningar(-)
diff --git a/framework/core.py b/framework/core.py
index ed6f15e..497bb36 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -188,7 +188,7 @@ def checkDir(dirname, failifexists):
exists = True
try:
os.stat(dirname)
- except OSError, e:
+ except OSError as e:
if e.errno == errno.ENOENT or e.errno == errno.ENOTDIR:
exists = False
@@ -198,7 +198,7 @@ def checkDir(dirname, failifexists):
try:
os.makedirs(dirname)
- except OSError, e:
+ except OSError as e:
if e.errno != errno.EEXIST:
raise
diff --git a/framework/junit.py b/framework/junit.py
index 8504795..6c284ca 100644
--- a/framework/junit.py
+++ b/framework/junit.py
@@ -307,9 +307,9 @@ class Test(BaseTest):
try:
try:
return self.test(report)
- except Failure, ex:
+ except Failure as ex:
report.addFailure(*ex.args)
- except Error, ex:
+ except Error as ex:
report.addError(*ex.args)
except KeyboardInterrupt:
raise
--
1.7.10.4
More information about the Piglit
mailing list