Break after annotation future found (#6284)

This commit is contained in:
Shahar Naveh authored and GitHub committed 2025-11-19 01:00:41 +09:00
1 parent bab03bd75b
commit f7ddcd2795
1 file changed
+3 -5
+3 -5
View File
@@ -736,12 +736,10 @@ impl SymbolTableBuilder {
if let Stmt::ImportFrom(StmtImportFrom { module, names, .. }) = &statement
&& module.as_ref().map(|id| id.as_str()) == Some("__future__")
{
for feature in names {
if &feature.name == "annotations" {
self.future_annotations = true;
}
}
self.future_annotations =
self.future_annotations || names.iter().any(|future| &future.name == "annotations");
}
match &statement {
Stmt::Global(StmtGlobal { names, .. }) => {
for name in names {