Unverified Kaydet (Commit) 79b5d290 authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733)

Fix reference hunting (``python3 -m test -R 3:3``) when Python has no
built-in abc module: fix _get_dump() reimplementation of libregrtest.
üst eb7e29f2
...@@ -8,9 +8,13 @@ from test import support ...@@ -8,9 +8,13 @@ from test import support
try: try:
from _abc import _get_dump from _abc import _get_dump
except ImportError: except ImportError:
import weakref
def _get_dump(cls): def _get_dump(cls):
# For legacy Python version # Reimplement _get_dump() for pure-Python implementation of
return (cls._abc_registry, cls._abc_cache, # the abc module (Lib/_py_abc.py)
registry_weakrefs = set(weakref.ref(obj) for obj in cls._abc_registry)
return (registry_weakrefs, cls._abc_cache,
cls._abc_negative_cache, cls._abc_negative_cache_version) cls._abc_negative_cache, cls._abc_negative_cache_version)
......
Fix reference hunting (``python3 -m test -R 3:3``) when Python has no
built-in abc module.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment