Index: Lib/test/regrtest.py =================================================================== --- Lib/test/regrtest.py (revision 61203) +++ Lib/test/regrtest.py (working copy) @@ -649,7 +649,6 @@ def dash_R(the_module, test, indirect_test, huntrleaks): # This code is hackish and inelegant, but it seems to do the job. import copy_reg, _abcoll - from abc import _Abstract if not hasattr(sys, 'gettotalrefcount'): raise Exception("Tracking reference leaks requires a debug build " @@ -661,8 +660,9 @@ pic = sys.path_importer_cache.copy() abcs = {} for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: - if not issubclass(abc, _Abstract): + if getattr(abc, '__abstractmethods__', None) is None: continue + print abc for obj in abc.__subclasses__() + [abc]: abcs[obj] = obj._abc_registry.copy() @@ -699,7 +699,6 @@ import _strptime, linecache, dircache import urlparse, urllib, urllib2, mimetypes, doctest import struct, filecmp, _abcoll - from abc import _Abstract from distutils.dir_util import _path_created # Restore some original values. @@ -714,7 +713,7 @@ # Clear ABC registries, restoring previously saved ABC registries. for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: - if not issubclass(abc, _Abstract): + if getattr(abc, '__abstractmethods__', None) is None: continue for obj in abc.__subclasses__() + [abc]: obj._abc_registry = abcs.get(obj, {}).copy()