[Python-3000-checkins] r59243 - python/branches/py3k/Lib/test/regrtest.py

Guido van Rossum guido at python.org
Fri Nov 30 23:13:58 CET 2007


Should this (and related checkins) be backported to 2.6 (which has
abc.py and _abcoll.py backported already)?

I guess we could consider applying ABC-related changes to 2.6 first
and merge them into 3.0.

--Guido

On Nov 30, 2007 1:53 PM, christian.heimes
<python-3000-checkins at python.org> wrote:
> Author: christian.heimes
> Date: Fri Nov 30 22:53:03 2007
> New Revision: 59243
>
> Modified:
>    python/branches/py3k/Lib/test/regrtest.py
> Log:
> Fixed problem with regrtest caused by the additional of objects to _abcoll.
>
> Modified: python/branches/py3k/Lib/test/regrtest.py
> ==============================================================================
> --- python/branches/py3k/Lib/test/regrtest.py   (original)
> +++ python/branches/py3k/Lib/test/regrtest.py   Fri Nov 30 22:53:03 2007
> @@ -689,6 +689,7 @@
>  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 @@
>      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 @@
>      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 @@
>
>      # 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()
> _______________________________________________
> Python-3000-checkins mailing list
> Python-3000-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-3000-checkins
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000-checkins mailing list