mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Oops, urllib may or may not already be loaded.
This commit is contained in:
parent
0917988f7c
commit
83cbb24cd4
1 changed files with 4 additions and 1 deletions
|
@ -255,7 +255,10 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
|
||||||
# Delete urllib from modules because urlparse was imported above.
|
# Delete urllib from modules because urlparse was imported above.
|
||||||
# Without this hack, test_socket_ssl fails if run in this order:
|
# Without this hack, test_socket_ssl fails if run in this order:
|
||||||
# regrtest.py test_codecmaps_tw test_importhooks test_socket_ssl
|
# 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():
|
def test_main():
|
||||||
test_support.run_unittest(ImportHooksTestCase)
|
test_support.run_unittest(ImportHooksTestCase)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue