From 4fd43df42a9705bdb7681f4d67fb49b8da24a5d9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 13 Apr 2012 19:47:13 -0700 Subject: Handle SystemError when importing xml libraries. --- pym/portage/xml/metadata.py | 6 +++--- pym/repoman/herdbase.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pym') diff --git a/pym/portage/xml/metadata.py b/pym/portage/xml/metadata.py index bed6a1e55..25f801a47 100644 --- a/pym/portage/xml/metadata.py +++ b/pym/portage/xml/metadata.py @@ -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 diff --git a/pym/repoman/herdbase.py b/pym/repoman/herdbase.py index 8ce36a704..91a32cb00 100644 --- a/pym/repoman/herdbase.py +++ b/pym/repoman/herdbase.py @@ -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 -- cgit v1.2.3-1-g7c22