Skip to content

Commit 8c4750a

Browse files
committed
Fix ForwardRef for Python 3.14
1 parent c7ece62 commit 8c4750a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylint/checkers/base/basic_error_checker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
ABC_METACLASSES = {"_py_abc.ABCMeta", "abc.ABCMeta"} # Python 3.7+,
2121
# List of methods which can be redefined
2222
REDEFINABLE_METHODS = frozenset(("__module__",))
23-
TYPING_FORWARD_REF_QNAME = "typing.ForwardRef"
23+
FORWARD_REF_QNAME = {"typing.ForwardRef", "annotationlib.ForwardRef"}
2424

2525

2626
def _get_break_loop_node(break_node: nodes.Break) -> nodes.For | nodes.While | None:
@@ -575,7 +575,7 @@ def _check_redefinition(
575575
if (
576576
inferred
577577
and isinstance(inferred, astroid.Instance)
578-
and inferred.qname() == TYPING_FORWARD_REF_QNAME
578+
and inferred.qname() in FORWARD_REF_QNAME
579579
):
580580
return
581581

0 commit comments

Comments
 (0)