diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-25 02:55:49 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-25 02:55:49 (GMT) |
commit | 545d4962f5860c49c44f06fc80c4678271cfac18 (patch) | |
tree | 5d9b58512713aaa3549250d5c5959d50a3a21907 | |
parent | 7025ce6fb06c273d929bd3cd26435b9140ead969 (diff) | |
download | cpython-545d4962f5860c49c44f06fc80c4678271cfac18.zip cpython-545d4962f5860c49c44f06fc80c4678271cfac18.tar.gz cpython-545d4962f5860c49c44f06fc80c4678271cfac18.tar.bz2 |
Cleanup a bit more references so test_urllibnet is stable (test_urllib2 is sometimes stable, at least in isolation)
-rwxr-xr-x | Lib/test/regrtest.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 71dc291..e27f1e3 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -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() |