Add '_py_abc' to the frame stack

This restores an alteration made by @coolreader18 a while back.
This commit is contained in:
Padraic Fanning committed 2021-08-18 20:08:18 -04:00
1 parent 48de03506c
commit 79779f87a5
1 file changed
+3 -1
+3 -1
View File
@@ -989,7 +989,9 @@ def _allow_reckless_class_cheks():
issubclass() on the whole MRO of a user class, which may contain protocols.
"""
try:
return sys._getframe(3).f_globals['__name__'] in ['abc', 'functools']
# XXX RUSTPYTHON: added _py_abc; I think CPython was fine because abc called
# directly into the _abc builtin module, which wasn't in the frame stack
return sys._getframe(3).f_globals['__name__'] in ['abc', 'functools', '_py_abc']
except (AttributeError, ValueError): # For platforms without _getframe().
return True