From: Serhiy Storchaka Date: Sun, 11 Aug 2013 17:12:20 +0000 (+0300) Subject: Issue #18706: Fix a test for issue #18681 so it no longer breaks test_codeccallbacks*. X-Git-Tag: v3.4.0a2~248^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b212291b08b8c7beffe8b2dbdd211ded05c84087;p=thirdparty%2FPython%2Fcpython.git Issue #18706: Fix a test for issue #18681 so it no longer breaks test_codeccallbacks*. --- diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index ade3e2564f33..3fb119bfc3fd 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -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)