diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-08-31 14:13:45 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-08-31 14:13:45 (GMT) |
commit | 5d0612411e3812d7e851fabeb5fd7f2f103f50d2 (patch) | |
tree | 47d95352548526a78833ce4f16a8298273674218 /Lib/test/test_import.py | |
parent | 2d337c70616af49cdf5200e145190601930b3476 (diff) | |
download | cpython-5d0612411e3812d7e851fabeb5fd7f2f103f50d2.zip cpython-5d0612411e3812d7e851fabeb5fd7f2f103f50d2.tar.gz cpython-5d0612411e3812d7e851fabeb5fd7f2f103f50d2.tar.bz2 |
Issue #15828: Restore support for C extension modules in imp.load_module()
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r-- | Lib/test/test_import.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 60447dc..19863b9 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -149,25 +149,6 @@ class ImportTests(unittest.TestCase): self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)), oct(mode)) - def test_imp_module(self): - # Verify that the imp module can correctly load and find .py files - # XXX (ncoghlan): It would be nice to use support.CleanImport - # here, but that breaks because the os module registers some - # handlers in copy_reg on import. Since CleanImport doesn't - # revert that registration, the module is left in a broken - # state after reversion. Reinitialising the module contents - # and just reverting os.environ to its previous state is an OK - # workaround - orig_path = os.path - orig_getenv = os.getenv - with EnvironmentVarGuard(): - x = imp.find_module("os") - self.addCleanup(x[0].close) - new_os = imp.load_module("os", *x) - self.assertIs(os, new_os) - self.assertIs(orig_path, new_os.path) - self.assertIsNot(orig_getenv, new_os.getenv) - def test_bug7732(self): source = TESTFN + '.py' os.mkdir(source) |