diff options
author | Christian Heimes <christian@cheimes.de> | 2008-03-03 19:18:51 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-03-03 19:18:51 (GMT) |
commit | be5b30b15f6ba8bb854968db3bd43390676b905b (patch) | |
tree | bc9f50a252ba8ad73136af4273222308a972d3c0 /Lib/test/regrtest.py | |
parent | 180510d29b369b88b0eb8815086162d2d6ef60a7 (diff) | |
download | cpython-be5b30b15f6ba8bb854968db3bd43390676b905b.zip cpython-be5b30b15f6ba8bb854968db3bd43390676b905b.tar.gz cpython-be5b30b15f6ba8bb854968db3bd43390676b905b.tar.bz2 |
Merged revisions 61203-61204 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61203 | christian.heimes | 2008-03-03 13:40:17 +0100 (Mon, 03 Mar 2008) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-60195" from
svn+ssh://pythondev@svn.python.org/python/branches/trunk-math
........
r61204 | christian.heimes | 2008-03-03 19:28:04 +0100 (Mon, 03 Mar 2008) | 1 line
Since abc._Abstract was replaces by a new type flags the regression test suite fails. I've added a new function inspect.isabstract(). Is the mmethod fine or should I check if object is a instance of type or subclass of object, too?
........
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 50ed93e..cb7cf75 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -135,6 +135,7 @@ import warnings import re import io import traceback +from inspect import isabstract # I see no other way to suppress these warnings; # putting them in test_grammar.py has no effect: @@ -689,7 +690,6 @@ 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 " @@ -701,7 +701,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks): pic = sys.path_importer_cache.copy() abcs = {} for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: - if not issubclass(abc, _Abstract): + if not isabstract(abc): continue for obj in abc.__subclasses__() + [abc]: abcs[obj] = obj._abc_registry.copy() @@ -741,7 +741,6 @@ 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 from weakref import WeakSet @@ -757,7 +756,7 @@ 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 issubclass(abc, _Abstract): + if not isabstract(abc): continue for obj in abc.__subclasses__() + [abc]: obj._abc_registry = abcs.get(obj, WeakSet()).copy() |