]> granicus.if.org Git - python/commitdiff
Oops, urllib may or may not already be loaded.
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 4 Mar 2006 23:56:53 +0000 (23:56 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 4 Mar 2006 23:56:53 +0000 (23:56 +0000)
Lib/test/test_importhooks.py

index 81b7ad1ba12394033f373a2198f3eda53bdbcd8e..ff777f61d357b64580ae34a9ae937b03788f9f0f 100644 (file)
@@ -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)