mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
7fc972a2aa
commit
9de80ac127
1 changed files with 4 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue