diff options
author | Raymond Hettinger <python@rcn.com> | 2011-02-22 00:41:50 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-02-22 00:41:50 (GMT) |
commit | 158c9c26fca16dee2f7a8d89707cf9c149bd04f2 (patch) | |
tree | 0d2dc227cb3abcf338e4dd4883fe5469f7c10d4e /Lib/test/regrtest.py | |
parent | ecc26923cd8a0a3511e1fb89b4b13d74a1391b87 (diff) | |
download | cpython-158c9c26fca16dee2f7a8d89707cf9c149bd04f2.zip cpython-158c9c26fca16dee2f7a8d89707cf9c149bd04f2.tar.gz cpython-158c9c26fca16dee2f7a8d89707cf9c149bd04f2.tar.bz2 |
Issue #11085: Moved collections abstract base classes into a separate module
called collections.abc, following the pattern used by importlib.abc. For
backwards compatibility, the names continue to also be imported into the
collections module.
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 440c01d..6267702 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1056,7 +1056,8 @@ def dash_R(the_module, test, indirect_test, huntrleaks): False if the test didn't leak references; True if we detected refleaks. """ # This code is hackish and inelegant, but it seems to do the job. - import copyreg, _abcoll + import copyreg + import collections.abc if not hasattr(sys, 'gettotalrefcount'): raise Exception("Tracking reference leaks requires a debug build " @@ -1073,7 +1074,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks): else: zdc = zipimport._zip_directory_cache.copy() abcs = {} - for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: + for abc in [getattr(collections.abc, a) for a in collections.abc.__all__]: if not isabstract(abc): continue for obj in abc.__subclasses__() + [abc]: @@ -1119,7 +1120,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): import gc, copyreg import _strptime, linecache import urllib.parse, urllib.request, mimetypes, doctest - import struct, filecmp, _abcoll + import struct, filecmp, collections.abc from distutils.dir_util import _path_created from weakref import WeakSet @@ -1146,7 +1147,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): sys._clear_type_cache() # Clear ABC registries, restoring previously saved ABC registries. - for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: + for abc in [getattr(collections.abc, a) for a in collections.abc.__all__]: if not isabstract(abc): continue for obj in abc.__subclasses__() + [abc]: |