diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2018-09-22 15:08:11 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-09-22 15:08:11 +0200 |
commit | 1644e44c921123d712d49cfceba9e360acd6bb64 (patch) | |
tree | 4ba21a0a19586c07b051db5e6e7829c46ebb8a74 /Cython/Compiler/ParseTreeTransforms.py | |
parent | a27760208d9ff436dd38088babc0f3b1b7384124 (diff) | |
download | cython-1644e44c921123d712d49cfceba9e360acd6bb64.tar.gz |
Prevent assigned global variables from being marked and treated as closure variables in generators and coroutines.
Closes #2613.
Diffstat (limited to 'Cython/Compiler/ParseTreeTransforms.py')
-rw-r--r-- | Cython/Compiler/ParseTreeTransforms.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 8138b22d5..9753a2f61 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -2677,7 +2677,7 @@ class CreateClosureClasses(CythonTransform): if node.is_generator: for scope in node.local_scope.iter_local_scopes(): for entry in scope.entries.values(): - if not entry.from_closure: + if not (entry.from_closure or entry.is_pyglobal or entry.is_cglobal): entry.in_closure = True from_closure, in_closure = self.find_entries_used_in_closures(node) |