Way too many places create modules temporarily that never set

__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).
This commit is contained in:
Brett Cannon 2013-02-03 16:16:07 -05:00
parent 27aea0ca07
commit 7a34f02f9e
1 changed files with 0 additions and 6 deletions

View File

@ -182,12 +182,6 @@ class StartupTests(unittest.TestCase):
# Issue #17098: all modules should have __loader__ defined. # Issue #17098: all modules should have __loader__ defined.
for name, module in sys.modules.items(): for name, module in sys.modules.items():
if isinstance(module, types.ModuleType): 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: if name in sys.builtin_module_names:
self.assertEqual(importlib.machinery.BuiltinImporter, self.assertEqual(importlib.machinery.BuiltinImporter,
module.__loader__) module.__loader__)