mirror of
https://github.com/python/cpython.git
synced 2025-11-09 18:11:38 +00:00
"Fix" for the refleak report: the ABC classes are now in the _pyio module
This commit is contained in:
parent
fe67bd9168
commit
e55df1fa2a
1 changed files with 2 additions and 2 deletions
|
|
@ -746,7 +746,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
|
||||||
False if the test didn't leak references; True if we detected refleaks.
|
False if the test didn't leak references; True if we detected refleaks.
|
||||||
"""
|
"""
|
||||||
# This code is hackish and inelegant, but it seems to do the job.
|
# This code is hackish and inelegant, but it seems to do the job.
|
||||||
import copy_reg, _abcoll, io
|
import copy_reg, _abcoll, _pyio
|
||||||
|
|
||||||
if not hasattr(sys, 'gettotalrefcount'):
|
if not hasattr(sys, 'gettotalrefcount'):
|
||||||
raise Exception("Tracking reference leaks requires a debug build "
|
raise Exception("Tracking reference leaks requires a debug build "
|
||||||
|
|
@ -757,7 +757,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
|
||||||
ps = copy_reg.dispatch_table.copy()
|
ps = copy_reg.dispatch_table.copy()
|
||||||
pic = sys.path_importer_cache.copy()
|
pic = sys.path_importer_cache.copy()
|
||||||
abcs = {}
|
abcs = {}
|
||||||
modules = _abcoll, io
|
modules = _abcoll, _pyio
|
||||||
for abc in [getattr(mod, a) for mod in modules for a in mod.__all__]:
|
for abc in [getattr(mod, a) for mod in modules for a in mod.__all__]:
|
||||||
# XXX isinstance(abc, ABCMeta) leads to infinite recursion
|
# XXX isinstance(abc, ABCMeta) leads to infinite recursion
|
||||||
if not hasattr(abc, '_abc_registry'):
|
if not hasattr(abc, '_abc_registry'):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue