diff options
author | Brett Cannon <brett@python.org> | 2013-02-01 21:36:29 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-02-01 21:36:29 (GMT) |
commit | 85ae3566d117df8f0ade3aa14a6ddda09711a663 (patch) | |
tree | 0c0fa3adacbe71bea2380abccca900017c3858f9 /Lib/test/test_importlib/test_api.py | |
parent | f41fa4f3a0b12161d8fcd58deb07756df929f405 (diff) | |
parent | da9cf0eef8c9cb338ad71330345423c9de2e0a01 (diff) | |
download | cpython-85ae3566d117df8f0ade3aa14a6ddda09711a663.zip cpython-85ae3566d117df8f0ade3aa14a6ddda09711a663.tar.gz cpython-85ae3566d117df8f0ade3aa14a6ddda09711a663.tar.bz2 |
Merge w/ 3.3 more fixes thanks to issue #17098
Diffstat (limited to 'Lib/test/test_importlib/test_api.py')
-rw-r--r-- | Lib/test/test_importlib/test_api.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index 7acb4ce..b39ab09 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -1,6 +1,7 @@ from . import util import imp import importlib +from importlib import _bootstrap from importlib import machinery import sys from test import support @@ -184,6 +185,14 @@ class StartupTests(unittest.TestCase): if isinstance(module, types.ModuleType): self.assertTrue(hasattr(module, '__loader__'), '{!r} lacks a __loader__ attribute'.format(name)) + if name in sys.builtin_module_names: + self.assertIn(module.__loader__, + (importlib.machinery.BuiltinImporter, + importlib._bootstrap.BuiltinImporter)) + elif imp.is_frozen(name): + self.assertIn(module.__loader__, + (importlib.machinery.FrozenImporter, + importlib._bootstrap.FrozenImporter)) if __name__ == '__main__': |