diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-02-08 02:01:13 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-02-08 02:01:13 -0800 |
commit | 8e6c622174ca5fb8ae1789687954e4335f7a0a2e (patch) | |
tree | 4c95a6ee1ad8c0da57b6db5a204468073151da08 /pym/repoman/herdbase.py | |
parent | 75c57abd6bdc86a2425d15013128e800c57ced7a (diff) | |
download | portage-8e6c622174ca5fb8ae1789687954e4335f7a0a2e.tar.gz portage-8e6c622174ca5fb8ae1789687954e4335f7a0a2e.tar.bz2 portage-8e6c622174ca5fb8ae1789687954e4335f7a0a2e.zip |
repoman.herdbase: tolerate expat ImportError
We tolerate global scope import failures for optional modules, so that
ImportModulesTestCase can succeed (or possibly alert us about
unexpected import failures).
Diffstat (limited to 'pym/repoman/herdbase.py')
-rw-r--r-- | pym/repoman/herdbase.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/repoman/herdbase.py b/pym/repoman/herdbase.py index 4808d3ca3..64b59e636 100644 --- a/pym/repoman/herdbase.py +++ b/pym/repoman/herdbase.py @@ -1,11 +1,18 @@ # -*- coding: utf-8 -*- # repoman: Herd database analysis -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 or later import errno import xml.etree.ElementTree -from xml.parsers.expat import ExpatError +try: + from xml.parsers.expat import ExpatError +except ImportError: + # This means that python is built without xml support. + # We tolerate global scope import failures for optional + # modules, so that ImportModulesTestCase can succeed (or + # possibly alert us about unexpected import failures). + pass from portage.exception import FileNotFound, ParseError, PermissionDenied __all__ = [ |