Oops, urllib may or may not already be loaded.
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
index 81b7ad1..ff777f6 100644
--- a/Lib/test/test_importhooks.py
+++ b/Lib/test/test_importhooks.py
@@ -255,7 +255,10 @@
# 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)