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

Dylan Baker baker.dylan.c at gmail.com
Wed Dec 17 09:49:35 PST 2014


With one very minor nit,
Reviewed-by: Dylan Baker <dylanx.c.baker at intel.com>

On Wednesday, December 17, 2014 11:05:29 AM Jose Fonseca wrote:
> 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.

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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141217/86a36dff/attachment.sig>


More information about the Piglit mailing list