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

2014-12-17 Thread Jose Fonseca
From: José Fonseca jfons...@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

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


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

2014-12-17 Thread Dylan Baker
With one very minor nit,
Reviewed-by: Dylan Baker dylanx.c.ba...@intel.com

On Wednesday, December 17, 2014 11:05:29 AM Jose Fonseca wrote:
 From: José Fonseca jfons...@vmware.com
 
 etree.XMLSyntaxError is only available with lxml.  etree.ParseError is
 available everywhere.  For lxml, etree.XMLSyntaxError is a subclass of
 etree.ParseError.

Actually, lxml.etree.ParseError is a subclass of
lxml.etree.XMLSyntaxError.

 ---
  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
 
 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit
 


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


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

2014-12-17 Thread Jose Fonseca

On 17/12/14 17:49, Dylan Baker wrote:

With one very minor nit,
Reviewed-by: Dylan Baker dylanx.c.ba...@intel.com


Thanks for the review.


On Wednesday, December 17, 2014 11:05:29 AM Jose Fonseca wrote:

From: José Fonseca jfons...@vmware.com

etree.XMLSyntaxError is only available with lxml.  etree.ParseError is
available everywhere.  For lxml, etree.XMLSyntaxError is a subclass of
etree.ParseError.


Actually, lxml.etree.ParseError is a subclass of
lxml.etree.XMLSyntaxError.


Really? Odd, `pydoc lxml.etree` shows otherwise:

$  pydoc lxml.etree
[...]
CLASSES
[...]
exceptions.Exception(exceptions.BaseException)
Error
LxmlError
C14NError
DTDError
DTDParseError
DTDValidateError
DocumentInvalid
LxmlRegistryError
NamespaceRegistryError
LxmlSyntaxError(LxmlError, exceptions.SyntaxError)
ParseError
XMLSyntaxError


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


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

2014-12-17 Thread Jose Fonseca

On 17/12/14 18:45, Jose Fonseca wrote:

On 17/12/14 17:49, Dylan Baker wrote:

With one very minor nit,
Reviewed-by: Dylan Baker dylanx.c.ba...@intel.com


Thanks for the review.


On Wednesday, December 17, 2014 11:05:29 AM Jose Fonseca wrote:

From: José Fonseca jfons...@vmware.com

etree.XMLSyntaxError is only available with lxml.  etree.ParseError is
available everywhere.  For lxml, etree.XMLSyntaxError is a subclass of
etree.ParseError.


Actually, lxml.etree.ParseError is a subclass of
lxml.etree.XMLSyntaxError.


Really? Odd, `pydoc lxml.etree` shows otherwise:

$  pydoc lxml.etree
[...]
CLASSES
[...]
 exceptions.Exception(exceptions.BaseException)
 Error
 LxmlError
 C14NError
 DTDError
 DTDParseError
 DTDValidateError
 DocumentInvalid
 LxmlRegistryError
 NamespaceRegistryError
 LxmlSyntaxError(LxmlError, exceptions.SyntaxError)
 ParseError
 XMLSyntaxError


Jose


Actually, I'm positive XMLSyntaxError is a subclass of ParseError, 
otherwise my patch wouldn't work at all with lxml, and I've verified it 
does.


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


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

2014-12-17 Thread Dylan Baker
You're correct. I misread xml.SyntaxError as XMLSyntaxError on the
webpage. oops

On Wednesday, December 17, 2014 06:45:11 PM Jose Fonseca wrote:
 On 17/12/14 17:49, Dylan Baker wrote:
  With one very minor nit,
  Reviewed-by: Dylan Baker dylanx.c.ba...@intel.com
 
 Thanks for the review.
 
  On Wednesday, December 17, 2014 11:05:29 AM Jose Fonseca wrote:
  From: José Fonseca jfons...@vmware.com
 
  etree.XMLSyntaxError is only available with lxml.  etree.ParseError is
  available everywhere.  For lxml, etree.XMLSyntaxError is a subclass of
  etree.ParseError.
 
  Actually, lxml.etree.ParseError is a subclass of
  lxml.etree.XMLSyntaxError.
 
 Really? Odd, `pydoc lxml.etree` shows otherwise:
 
 $  pydoc lxml.etree
 [...]
 CLASSES
 [...]
  exceptions.Exception(exceptions.BaseException)
  Error
  LxmlError
  C14NError
  DTDError
  DTDParseError
  DTDValidateError
  DocumentInvalid
  LxmlRegistryError
  NamespaceRegistryError
  LxmlSyntaxError(LxmlError, exceptions.SyntaxError)
  ParseError
  XMLSyntaxError
 
 
 Jose


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit