mirror of https://github.com/python/cpython
test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache. Clearing the cache should make it stop showing up in refleak reports.
This commit is contained in:
parent
7763351808
commit
1bddfb84ee
|
@ -545,6 +545,7 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
|
|||
def cleanup():
|
||||
import _strptime, linecache, warnings, dircache
|
||||
import urlparse, urllib, urllib2, mimetypes, doctest
|
||||
import struct
|
||||
from distutils.dir_util import _path_created
|
||||
_path_created.clear()
|
||||
warnings.filters[:] = fs
|
||||
|
@ -561,6 +562,7 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False):
|
|||
dircache.reset()
|
||||
linecache.clearcache()
|
||||
mimetypes._default_mime_types()
|
||||
struct._cache.clear()
|
||||
doctest.master = None
|
||||
if indirect_test:
|
||||
def run_the_test():
|
||||
|
|
Loading…
Reference in New Issue