Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
f3f5cd7e
Commit
f3f5cd7e
authored
Aug 30, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler crash when using locals() and generator expressions in the same function
parent
cdb895f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+4
-2
tests/run/generator_expressions_and_locals.pyx
tests/run/generator_expressions_and_locals.pyx
+10
-0
No files found.
Cython/Compiler/Nodes.py
View file @
f3f5cd7e
...
@@ -3057,8 +3057,10 @@ class GeneratorBodyDefNode(DefNode):
...
@@ -3057,8 +3057,10 @@ class GeneratorBodyDefNode(DefNode):
def
declare_generator_body
(
self
,
env
):
def
declare_generator_body
(
self
,
env
):
prefix
=
env
.
next_id
(
env
.
scope_prefix
)
prefix
=
env
.
next_id
(
env
.
scope_prefix
)
name
=
env
.
next_id
(
'generator'
)
name
=
env
.
next_id
(
'generator'
)
entry
=
env
.
declare_var
(
prefix
+
name
,
py_object_type
,
self
.
pos
,
visibility
=
'private'
)
cname
=
Naming
.
genbody_prefix
+
prefix
+
name
entry
.
func_cname
=
Naming
.
genbody_prefix
+
prefix
+
name
entry
=
env
.
declare_var
(
None
,
py_object_type
,
self
.
pos
,
cname
=
cname
,
visibility
=
'private'
)
entry
.
func_cname
=
cname
entry
.
qualified_name
=
EncodedString
(
self
.
name
)
entry
.
qualified_name
=
EncodedString
(
self
.
name
)
self
.
entry
=
entry
self
.
entry
=
entry
...
...
tests/run/generator_expressions_and_locals.pyx
0 → 100644
View file @
f3f5cd7e
# mode: run
# tag: genexpr, locals
def
genexpr_not_in_locals
():
"""
>>> genexpr_not_in_locals()
{'t': (0, 1, 4, 9, 16, 25, 36, 49, 64, 81)}
"""
t
=
tuple
(
x
*
x
for
x
in
range
(
10
))
return
locals
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment