From 247c90040c368d577a3cf25717678f44376f02a1 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Tue, 1 Sep 2026 17:43:57 -0400 Subject: [PATCH] remove redundant check in handleAnnotation this is already handled in CONSTANT --- pyflakes/checker.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pyflakes/checker.py b/pyflakes/checker.py index 8c61de36..bd7596e9 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -1313,20 +1313,7 @@ def handle_annotation_always_deferred(self, annotation, parent): @in_annotation def handleAnnotation(self, annotation, node): - if ( - isinstance(annotation, ast.Constant) and - isinstance(annotation.value, str) - ): - # Defer handling forward annotation. - self.deferFunction(functools.partial( - self.handleStringAnnotation, - annotation.value, - node, - annotation.lineno, - annotation.col_offset, - messages.ForwardAnnotationSyntaxError, - )) - elif self.annotationsFutureEnabled or sys.version_info >= (3, 14): + if self.annotationsFutureEnabled or sys.version_info >= (3, 14): self.handle_annotation_always_deferred(annotation, node) else: self.handleNode(annotation, node)