def testImportModules(self):
expected_failures = frozenset((
- 'repoman.herdbase', # requires python with xml support
))
for mod in self._iter_modules(PORTAGE_PYM_PATH):
# -*- 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__ = [