[Piglit] [PATCH] framework: Fix 'module' object has no attribute 'XMLSyntaxError'.

Jose Fonseca jfonseca at vmware.com
Wed Dec 17 03:05:29 PST 2014


From: José Fonseca <jfonseca at vmware.com>

etree.XMLSyntaxError is only available with lxml.  etree.ParseError is
available everywhere.  For lxml, etree.XMLSyntaxError is a subclass of
etree.ParseError.
---
 framework/backends/junit.py       | 2 +-
 framework/tests/backends_tests.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/backends/junit.py b/framework/backends/junit.py
index de8fd71..10e52ec 100644
--- a/framework/backends/junit.py
+++ b/framework/backends/junit.py
@@ -87,7 +87,7 @@ class JUnitBackend(FileBackend):
                 # failed transaction and ignore it.
                 try:
                     piglit.append(etree.parse(f).getroot())
-                except etree.XMLSyntaxError:
+                except etree.ParseError:
                     continue
 
         # set the test count by counting the number of tests.
diff --git a/framework/tests/backends_tests.py b/framework/tests/backends_tests.py
index 9050c38..b8d88e3 100644
--- a/framework/tests/backends_tests.py
+++ b/framework/tests/backends_tests.py
@@ -268,5 +268,5 @@ def test_junit_skips_bad_tests():
 
         try:
             test.finalize()
-        except etree.XMLSyntaxError as e:
+        except etree.ParseError as e:
             raise AssertionError(e)
-- 
2.1.0



More information about the Piglit mailing list