From de6dff94cd13ab862a4f76a443bb41d9fd6cdb69 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 13 Jun 2015 12:58:45 +0300 Subject: [PATCH] GeneratorExp also includes assignment context. --- artiq/py2llvm/typing.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/artiq/py2llvm/typing.py b/artiq/py2llvm/typing.py index 87d68e797..ca7933bad 100644 --- a/artiq/py2llvm/typing.py +++ b/artiq/py2llvm/typing.py @@ -58,12 +58,13 @@ class LocalExtractor(algorithm.Visitor): self.in_root = True self.generic_visit(node) - visit_ClassDef = visit_root # don't look at inner scopes - visit_FunctionDef = visit_root - visit_Lambda = visit_root - visit_DictComp = visit_root - visit_ListComp = visit_root - visit_SetComp = visit_root + visit_ClassDef = visit_root # don't look at inner scopes + visit_FunctionDef = visit_root + visit_Lambda = visit_root + visit_DictComp = visit_root + visit_ListComp = visit_root + visit_SetComp = visit_root + visit_GeneratorExp = visit_root def _assignable(self, name): if name not in self.typing_env and name not in self.nonlocal_: