diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-20 21:37:17 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-20 21:37:17 (GMT) |
| commit | 6ae1e7f04e9817dd4a92584c608469a47eea2f56 (patch) | |
| tree | b979958421bc7065133c2b0fbe9539b8bfe2dae0 /Lib/test | |
| parent | 6a1454f3a441b6f84cabaff250b2744a5e4f4ec0 (diff) | |
| download | cpython-6ae1e7f04e9817dd4a92584c608469a47eea2f56.zip cpython-6ae1e7f04e9817dd4a92584c608469a47eea2f56.tar.gz cpython-6ae1e7f04e9817dd4a92584c608469a47eea2f56.tar.bz2 | |
Issue #3080: imp.load_module() accepts None for the module path
imp.find_module() returns None as module path for builtin and frozen builtins.
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_importhooks.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py index dca5685..7a25657 100644 --- a/Lib/test/test_importhooks.py +++ b/Lib/test/test_importhooks.py @@ -229,7 +229,9 @@ class ImportHooksTestCase(ImportHooksBaseTestCase): i = ImpWrapper() sys.meta_path.append(i) sys.path_hooks.append(ImpWrapper) - mnames = ("colorsys", "urllib.parse", "distutils.core") + mnames = ( + "colorsys", "urllib.parse", "distutils.core", "sys", + ) for mname in mnames: parent = mname.split(".")[0] for n in list(sys.modules): @@ -237,7 +239,8 @@ class ImportHooksTestCase(ImportHooksBaseTestCase): del sys.modules[n] for mname in mnames: m = __import__(mname, globals(), locals(), ["__dummy__"]) - m.__loader__ # to make sure we actually handled the import + # to make sure we actually handled the import + self.assertTrue(hasattr(m, "__loader__")) def test_main(): |
