Handle SystemError when importing xml libraries.
authorZac Medico <zmedico@gentoo.org>
Sat, 14 Apr 2012 02:47:13 +0000 (19:47 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 14 Apr 2012 02:47:13 +0000 (19:47 -0700)
bin/repoman
pym/portage/xml/metadata.py
pym/repoman/herdbase.py

index 076d4042ffc536d5b83d1e99eda940a0939c6d31..42539241e7d83585c1e72949dfff05420fbb0e84 100755 (executable)
@@ -45,7 +45,7 @@ portage.dep._internal_warnings = True
 try:
        import xml.etree.ElementTree
        from xml.parsers.expat import ExpatError
-except ImportError:
+except (ImportError, SystemError):
        msg = ["Please enable python's \"xml\" USE flag in order to use repoman."]
        from portage.output import EOutput
        out = EOutput()
index bed6a1e55d662cdcec26807e906cbb3da71f9881..25f801a47a505aa1d91aab2f32ef2d71cafedd7b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 """Provides an easy-to-use python interface to Gentoo's metadata.xml file.
@@ -42,12 +42,12 @@ if sys.hexversion < 0x2070000 or \
 else:
        try:
                import xml.etree.cElementTree as etree
-       except ImportError:
+       except (ImportError, SystemError):
                import xml.etree.ElementTree as etree
 
 try:
        from xml.parsers.expat import ExpatError
-except ImportError:
+except (ImportError, SystemError):
        ExpatError = SyntaxError
 
 import re
index 8ce36a704a5baa5994c715d16b9fd4b28a5a185f..91a32cb00ebe17ad49e5a3c1bf721935224eb5d2 100644 (file)
@@ -1,13 +1,13 @@
 # -*- coding: utf-8 -*-
 # repoman: Herd database analysis
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2 or later
 
 import errno
 import xml.etree.ElementTree
 try:
        from xml.parsers.expat import ExpatError
-except ImportError:
+except (ImportError, SystemError):
        # This means that python is built without xml support.
        # We tolerate global scope import failures for optional
        # modules, so that ImportModulesTestCase can succeed (or