summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importhooks.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-04 23:56:53 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-04 23:56:53 (GMT)
commit83cbb24cd4d7ae3b6737956ee1b6471bc322b8fa (patch)
tree5afc03008cbc2861023be60606dd714a39b3b644 /Lib/test/test_importhooks.py
parent0917988f7c9fea8fb15c4d54cf54452cded6c582 (diff)
downloadcpython-83cbb24cd4d7ae3b6737956ee1b6471bc322b8fa.zip
cpython-83cbb24cd4d7ae3b6737956ee1b6471bc322b8fa.tar.gz
cpython-83cbb24cd4d7ae3b6737956ee1b6471bc322b8fa.tar.bz2
Oops, urllib may or may not already be loaded.
Diffstat (limited to 'Lib/test/test_importhooks.py')
-rw-r--r--Lib/test/test_importhooks.py5
1 files changed, 4 insertions, 1 deletions
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 @@ 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)