diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-13 16:29:04 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-13 16:29:04 (GMT) |
commit | 060cee221b7d24479da93d925607defb2b6e3dd9 (patch) | |
tree | 406edb569f120be79a1f057268c511ad2311841e /Lib/test/test_pkg.py | |
parent | 88d1bc448bdc2bab0531a729893532cdf2307b28 (diff) | |
download | cpython-060cee221b7d24479da93d925607defb2b6e3dd9.zip cpython-060cee221b7d24479da93d925607defb2b6e3dd9.tar.gz cpython-060cee221b7d24479da93d925607defb2b6e3dd9.tar.bz2 |
Issue #6551: test_zipimport could import and then destroy some modules of
the encodings package, which would make other tests fail further down
the road because the internally cached encoders and decoders would point
to empty global variables.
Diffstat (limited to 'Lib/test/test_pkg.py')
-rw-r--r-- | Lib/test/test_pkg.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py index 0c568bb..2e293f4 100644 --- a/Lib/test/test_pkg.py +++ b/Lib/test/test_pkg.py @@ -48,13 +48,11 @@ class TestPkg(unittest.TestCase): self.root = None self.pkgname = None self.syspath = list(sys.path) - self.sysmodules = sys.modules.copy() + self.modules_before = support.modules_setup() def tearDown(self): sys.path[:] = self.syspath - sys.modules.clear() - sys.modules.update(self.sysmodules) - del self.sysmodules + support.modules_cleanup(*self.modules_before) cleanout(self.root) # delete all modules concerning the tested hiearchy |