Commit 79b5d290 authored by Victor Stinner's avatar Victor Stinner Committed by 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.
parent eb7e29f2
......@@ -8,9 +8,13 @@ from test import support
try:
from _abc import _get_dump
except ImportError:
import weakref
def _get_dump(cls):
# For legacy Python version
return (cls._abc_registry, cls._abc_cache,
# Reimplement _get_dump() for pure-Python implementation of
# 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)
......
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