Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a34f02

Browse files
committed
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).
1 parent 27aea0c commit 7a34f02

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

Lib/test/test_importlib/test_api.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ def test_everyone_has___loader__(self):
182182
# Issue #17098: all modules should have __loader__ defined.
183183
for name, module in sys.modules.items():
184184
if isinstance(module, types.ModuleType):
185-
# pyexpat/xml.parsers.expat have submodules that it creates
186-
# by hand and do not set __loader__, which is acceptable.
187-
if 'expat' in name:
188-
continue
189-
self.assertTrue(hasattr(module, '__loader__'),
190-
'{!r} lacks a __loader__ attribute'.format(name))
191185
if name in sys.builtin_module_names:
192186
self.assertEqual(importlib.machinery.BuiltinImporter,
193187
module.__loader__)

0 commit comments

Comments
 (0)