Skip to content

Commit 519898d

Browse files
committed
Simply add _py_abc
1 parent 8e21694 commit 519898d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/typing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,9 @@ def _allow_reckless_class_checks(depth=2):
18601860
The abc and functools modules indiscriminately call isinstance() and
18611861
issubclass() on the whole MRO of a user class, which may contain protocols.
18621862
"""
1863-
return _caller(depth) in {'abc', 'functools', None}
1863+
# gh-136047: When `_abc` module is not available, `_py_abc` is required to
1864+
# allow `_py_abc.ABCMeta` fallback.
1865+
return _caller(depth) in {'abc', '_py_abc', 'functools', None}
18641866

18651867

18661868
_PROTO_ALLOWLIST = {

0 commit comments

Comments
 (0)