Skip to content

Commit 5ce0e69

Browse files
authored
Fix TypeError with evaluate_forward_ref on some 3.10 and 3.9 versions (#558)
python/cpython#30926
1 parent 304f5cb commit 5ce0e69

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Bugfixes and changed features:
44
- Fix regression in 4.13.0 on Python 3.10.2 causing a `TypeError` when using `Concatenate`.
55
Patch by [Daraan](https://github.com/Daraan).
6+
- Fix `TypeError` when using `evaluate_forward_ref` on Python 3.10.1-2 and 3.9.8-10.
7+
Patch by [Daraan](https://github.com/Daraan).
68

79
# Release 4.13.0 (March 25, 2025)
810

src/typing_extensions.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4371,7 +4371,11 @@ def _lax_type_check(
43714371
A lax Python 3.11+ like version of typing._type_check
43724372
"""
43734373
if hasattr(typing, "_type_convert"):
4374-
if _FORWARD_REF_HAS_CLASS:
4374+
if (
4375+
sys.version_info >= (3, 10, 3)
4376+
or (3, 9, 10) < sys.version_info[:3] < (3, 10)
4377+
):
4378+
# allow_special_forms introduced later cpython/#30926 (bpo-46539)
43754379
type_ = typing._type_convert(
43764380
value,
43774381
module=module,

0 commit comments

Comments
 (0)