diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-30 21:53:03 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-30 21:53:03 (GMT) |
commit | 941973a32808226cfe3b7f8c0dca704e76435c3d (patch) | |
tree | 763ce9e5540f6a2ed1e5aae56088fea10cfc9995 | |
parent | d59c64c49fe66c8cccd22e9bda570f71f70e6014 (diff) | |
download | cpython-941973a32808226cfe3b7f8c0dca704e76435c3d.zip cpython-941973a32808226cfe3b7f8c0dca704e76435c3d.tar.gz cpython-941973a32808226cfe3b7f8c0dca704e76435c3d.tar.bz2 |
Fixed problem with regrtest caused by the additional of objects to _abcoll.
-rwxr-xr-x | Lib/test/regrtest.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index a780c7c..55817ff 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -689,6 +689,7 @@ def cleanup_test_droppings(testname, verbose): 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 " @@ -699,7 +700,8 @@ def dash_R(the_module, test, indirect_test, huntrleaks): ps = copy_reg.dispatch_table.copy() pic = sys.path_importer_cache.copy() abcs = {obj: obj._abc_registry.copy() - for abc in [getattr(_abcoll, a) for a in _abcoll.__all__] + for abc in [getattr(_abcoll, a) for a in _abcoll.__all__ + if isinstance(getattr(_abcoll, a), _Abstract)] for obj in abc.__subclasses__() + [abc]} if indirect_test: @@ -737,6 +739,7 @@ def dash_R_cleanup(fs, ps, pic, abcs): 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. @@ -748,6 +751,8 @@ def dash_R_cleanup(fs, ps, pic, abcs): # Clear ABC registries, restoring previously saved ABC registries. for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: + if not isinstance(abc, _Abstract): + continue for obj in abc.__subclasses__() + [abc]: obj._abc_registry = abcs.get(obj, {}).copy() obj._abc_cache.clear() |