]> granicus.if.org Git - python/commitdiff
Way too many places create modules temporarily that never set
authorBrett Cannon <brett@python.org>
Sun, 3 Feb 2013 21:16:07 +0000 (16:16 -0500)
committerBrett Cannon <brett@python.org>
Sun, 3 Feb 2013 21:16:07 +0000 (16:16 -0500)
__loader__ for this test to succeed without a major changes. It also
doesn't test the original issue of modules imported by Py_Initialize()
having __loader__ set (the rest of the test covers that).

Lib/test/test_importlib/test_api.py

index 162354b254ba549221313ec5c7fe68d56dd51af1..b1a58944f3d7920613b70225bbeb881c0c914367 100644 (file)
@@ -182,12 +182,6 @@ 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:
                     self.assertEqual(importlib.machinery.BuiltinImporter,
                                      module.__loader__)