summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-03-20 02:12:05 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-03-20 02:12:05 (GMT)
commit0ca22126ce8b0e5a5ea916e1fb1dac9ce9fb4557 (patch)
tree6e341601ad7bd606ce2a9a177687921be465196d
parent5a8605ec1cf5cd388dcde9a3cd90b3ef6061bcc7 (diff)
downloadcpython-0ca22126ce8b0e5a5ea916e1fb1dac9ce9fb4557.zip
cpython-0ca22126ce8b0e5a5ea916e1fb1dac9ce9fb4557.tar.gz
cpython-0ca22126ce8b0e5a5ea916e1fb1dac9ce9fb4557.tar.bz2
Merge revs 42842, 42844, and part of a whitespace normalization
patch from the trunk. This stops test_socket_ssl from dying with: TypeError: 'NoneType' object is not callable in urlparsre.py's urljoin() when the tests are run in this order: test_??? test_importhooks test_socket_ssl "test_???" can be various things, but must be there. For example, test_urllibnet "works" to provoke the failure. Alas, nobody actually understands _why_ test_socket_ssl fails then, or why this hack makes the problem go away. Amazingly, the tests just happened to run in the right order on the 2.4 branch on two Windows buildbot slaves today, causing them both to fail their most recent test runs before this patch.
-rw-r--r--Lib/test/test_importhooks.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
index 9304213..847f089 100644
--- a/Lib/test/test_importhooks.py
+++ b/Lib/test/test_importhooks.py
@@ -212,6 +212,13 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
for mname in mnames:
m = __import__(mname, globals(), locals(), ["__dummy__"])
m.__loader__ # to make sure we actually handled the import
+ # 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
+ try:
+ del sys.modules['urllib']
+ except KeyError:
+ pass
def test_main():
test_support.run_unittest(ImportHooksTestCase)