From: Neal Norwitz Date: Sat, 4 Mar 2006 23:56:53 +0000 (+0000) Subject: Oops, urllib may or may not already be loaded. X-Git-Tag: v2.5a0~363 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83cbb24cd4d7ae3b6737956ee1b6471bc322b8fa;p=thirdparty%2FPython%2Fcpython.git Oops, urllib may or may not already be loaded. --- diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py index 81b7ad1ba123..ff777f61d357 100644 --- a/Lib/test/test_importhooks.py +++ b/Lib/test/test_importhooks.py @@ -255,7 +255,10 @@ class ImportHooksTestCase(ImportHooksBaseTestCase): # Delete urllib from modules because urlparse was imported above. # Without this hack, test_socket_ssl fails if run in this order: # regrtest.py test_codecmaps_tw test_importhooks test_socket_ssl - del sys.modules['urllib'] + try: + del sys.modules['urllib'] + except KeyError: + pass def test_main(): test_support.run_unittest(ImportHooksTestCase)