repoman: ElementTree.ParseError -> SyntaxError
authorZac Medico <zmedico@gentoo.org>
Sun, 3 Jul 2011 15:52:37 +0000 (08:52 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 3 Jul 2011 15:52:37 +0000 (08:52 -0700)
The ElementTree.ParseError class is undocumented and isn't available
in python-2.6, so use its SyntaxError base class instead.

bin/repoman

index 0e3820faef7d2753fac7ffc67c65b6cee9eb9ab6..d1d393a82399d2ccdb6e9dcdd2cea5f3f4d27923 100755 (executable)
@@ -1404,7 +1404,7 @@ for x in scanlist:
                                os.path.join(checkdir, "metadata.xml"),
                                parser=xml.etree.ElementTree.XMLParser(
                                        target=_MetadataTreeBuilder()))
-               except (xml.etree.ElementTree.ParseError, ExpatError, EnvironmentError) as e:
+               except (ExpatError, SyntaxError, EnvironmentError) as e:
                        metadata_bad = True
                        stats["metadata.bad"] += 1
                        fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))