mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-136047: Allow typing._allow_reckless_class_checks to check _py_abc (#136115)
This commit is contained in:
parent
5b56daa9d7
commit
887e5c8646
2 changed files with 5 additions and 1 deletions
|
|
@ -1866,7 +1866,9 @@ def _allow_reckless_class_checks(depth=2):
|
|||
The abc and functools modules indiscriminately call isinstance() and
|
||||
issubclass() on the whole MRO of a user class, which may contain protocols.
|
||||
"""
|
||||
return _caller(depth) in {'abc', 'functools', None}
|
||||
# gh-136047: When `_abc` module is not available, `_py_abc` is required to
|
||||
# allow `_py_abc.ABCMeta` fallback.
|
||||
return _caller(depth) in {'abc', '_py_abc', 'functools', None}
|
||||
|
||||
|
||||
_PROTO_ALLOWLIST = {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Fix issues with :mod:`typing` when the C implementation of :mod:`abc` is not
|
||||
available.
|
||||
Loading…
Add table
Add a link
Reference in a new issue