]> granicus.if.org Git - python/commitdiff
Cleanup a bit more references so test_urllibnet is stable (test_urllib2 is sometimes...
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 25 Nov 2005 02:55:49 +0000 (02:55 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 25 Nov 2005 02:55:49 +0000 (02:55 +0000)
Lib/test/regrtest.py

index 71dc291a79c6d9561ec43c2d44506052a579c52e..e27f1e338a62466f435a985aee4e560da619ce91 100755 (executable)
@@ -490,8 +490,8 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
                 pic = sys.path_importer_cache.copy()
                 import gc
                 def cleanup():
-                    import _strptime, urlparse, warnings, dircache
-                    import linecache
+                    import _strptime, linecache, warnings, dircache
+                    import urlparse, urllib, urllib2
                     from distutils.dir_util import _path_created
                     _path_created.clear()
                     warnings.filters[:] = fs
@@ -499,6 +499,8 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
                     sre.purge()
                     _strptime._regex_cache.clear()
                     urlparse.clear_cache()
+                    urllib.urlcleanup()
+                    urllib2.install_opener(None)
                     copy_reg.dispatch_table.clear()
                     copy_reg.dispatch_table.update(ps)
                     sys.path_importer_cache.clear()