mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Break after annotation future found (#6284)
This commit is contained in:
1 parent
bab03bd75b
commit
f7ddcd2795
1 file changed
+3
-5
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user