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
0b133e00
Commit
0b133e00
authored
Apr 22, 2012
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't add vars that can't be coerced to PyObject into locals() dict
parent
cd32184f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-1
tests/run/locals.pyx
tests/run/locals.pyx
+8
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
0b133e00
...
@@ -6726,7 +6726,9 @@ class GlobalsExprNode(AtomicExprNode):
...
@@ -6726,7 +6726,9 @@ class GlobalsExprNode(AtomicExprNode):
class
FuncLocalsExprNode
(
DictNode
):
class
FuncLocalsExprNode
(
DictNode
):
def
__init__
(
self
,
pos
,
env
):
def
__init__
(
self
,
pos
,
env
):
local_vars
=
[
var
.
name
for
var
in
env
.
entries
.
values
()
if
var
.
name
]
local_vars
=
[
entry
.
name
for
entry
in
env
.
entries
.
values
()
if
entry
.
name
and
(
entry
.
type
is
unspecified_type
or
entry
.
type
.
can_coerce_to_pyobject
(
env
))]
items
=
[
DictItemNode
(
pos
,
key
=
IdentifierStringNode
(
pos
,
value
=
var
),
items
=
[
DictItemNode
(
pos
,
key
=
IdentifierStringNode
(
pos
,
value
=
var
),
value
=
NameNode
(
pos
,
name
=
var
,
allow_null
=
True
))
value
=
NameNode
(
pos
,
name
=
var
,
allow_null
=
True
))
for
var
in
local_vars
]
for
var
in
local_vars
]
...
...
tests/run/locals.pyx
View file @
0b133e00
...
@@ -71,3 +71,11 @@ def sorted(it):
...
@@ -71,3 +71,11 @@ def sorted(it):
l
=
list
(
it
)
l
=
list
(
it
)
l
.
sort
()
l
.
sort
()
return
l
return
l
def
locals_ctype
():
"""
>>> locals_ctype()
False
"""
cdef
int
*
p
=
NULL
return
'p'
in
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