summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-02-03 16:37:13 (GMT)
committerBrett Cannon <brett@python.org>2013-02-03 16:37:13 (GMT)
commit9de80ac127a9cd9fab39844fcf0a58d1f9720363 (patch)
tree5e5a34534f7d7acefa2902265b0320b0d9fdc6ac /Lib/test/test_importlib
parent7fc972a2aa041a978b8c4b1b58d6406100a2db8d (diff)
downloadcpython-9de80ac127a9cd9fab39844fcf0a58d1f9720363.zip
cpython-9de80ac127a9cd9fab39844fcf0a58d1f9720363.tar.gz
cpython-9de80ac127a9cd9fab39844fcf0a58d1f9720363.tar.bz2
pyexpat/xml.parsers.expat create their errors and model modules from
scratch. This means they do not set __loader__ by default. This is acceptable under importlib/PEP 302 definitions, so relax the test that was trying to apply this universally.
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/test_api.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py
index 5d63d85..162354b 100644
--- a/Lib/test/test_importlib/test_api.py
+++ b/Lib/test/test_importlib/test_api.py
@@ -182,6 +182,10 @@ class StartupTests(unittest.TestCase):
# Issue #17098: all modules should have __loader__ defined.
for name, module in sys.modules.items():
if isinstance(module, types.ModuleType):
+ # pyexpat/xml.parsers.expat have submodules that it creates
+ # by hand and do not set __loader__, which is acceptable.
+ if 'expat' in name:
+ continue
self.assertTrue(hasattr(module, '__loader__'),
'{!r} lacks a __loader__ attribute'.format(name))
if name in sys.builtin_module_names: