mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Add '_py_abc' to the frame stack
This restores an alteration made by @coolreader18 a while back.
This commit is contained in:
1 file changed
+3
-1
Vendored
+3
-1
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user