diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/_abcoll.py | 2 | ||||
-rwxr-xr-x | Lib/test/regrtest.py | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index cd1c9ce..5fbb219 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -4,7 +4,7 @@ """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported -via collections; they are defined here only to alleviate ceratin +via collections; they are defined here only to alleviate certain bootstrapping issues. Unit tests are in test_collections. """ diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 5dfc9d4..8c4b5e5 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -697,7 +697,7 @@ def dash_R_cleanup(fs, ps, pic): import gc, copy_reg import _strptime, linecache, dircache import urlparse, urllib, urllib2, mimetypes, doctest - import struct, filecmp, collections + import struct, filecmp, _abcoll from distutils.dir_util import _path_created # Restore some original values. @@ -708,8 +708,11 @@ def dash_R_cleanup(fs, ps, pic): sys.path_importer_cache.update(pic) # Clear ABC registries. - for obj in [collections.Hashable, collections.Iterable]: - obj._ABCMeta__registry.clear() + for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: + for obj in abc.__subclasses__() + [abc]: + obj._ABCMeta__registry.clear() + obj._ABCMeta__cache.clear() + obj._ABCMeta__negative_cache.clear() # Clear assorted module caches. _path_created.clear() |