]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #18706: Fix a test for issue #18681 so it no longer breaks test_codeccallbacks*.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 11 Aug 2013 17:12:20 +0000 (20:12 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 11 Aug 2013 17:12:20 +0000 (20:12 +0300)
Lib/test/test_imp.py

index ade3e2564f3300716afb467d0366d9c9b3452794..3fb119bfc3fdaf7023bf70a8af22052a37b4d4a3 100644 (file)
@@ -278,8 +278,9 @@ class ReloadTests(unittest.TestCase):
     def test_with_deleted_parent(self):
         # see #18681
         from html import parser
-        del sys.modules['html']
-        def cleanup(): del sys.modules['html.parser']
+        html = sys.modules.pop('html')
+        def cleanup():
+            sys.modules['html'] = html
         self.addCleanup(cleanup)
         with self.assertRaisesRegex(ImportError, 'html'):
             imp.reload(parser)