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
Gwenaël Samain
cython
Commits
66c059d8
Commit
66c059d8
authored
Aug 28, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repair analysis scope and qualified name of cpdef wrapper node
parent
1b401b30
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+21
-3
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
66c059d8
...
@@ -1697,6 +1697,8 @@ if VALUE is not None:
...
@@ -1697,6 +1697,8 @@ if VALUE is not None:
def
visit_DefNode
(
self
,
node
):
def
visit_DefNode
(
self
,
node
):
node
=
self
.
visit_FuncDefNode
(
node
)
node
=
self
.
visit_FuncDefNode
(
node
)
env
=
self
.
current_env
()
env
=
self
.
current_env
()
if
node
.
is_wrapper
:
env
=
env
.
parent_scope
if
(
not
isinstance
(
node
,
Nodes
.
DefNode
)
or
if
(
not
isinstance
(
node
,
Nodes
.
DefNode
)
or
node
.
fused_py_func
or
node
.
is_generator_body
or
node
.
fused_py_func
or
node
.
is_generator_body
or
not
node
.
needs_assignment_synthesis
(
env
)):
not
node
.
needs_assignment_synthesis
(
env
)):
...
@@ -1949,13 +1951,29 @@ class CalculateQualifiedNamesTransform(EnvTransform):
...
@@ -1949,13 +1951,29 @@ class CalculateQualifiedNamesTransform(EnvTransform):
return
node
return
node
def
visit_PyCFunctionNode
(
self
,
node
):
def
visit_PyCFunctionNode
(
self
,
node
):
orig_qualified_name
=
self
.
qualified_name
[:]
if
node
.
def_node
.
is_wrapper
and
self
.
qualified_name
:
assert
self
.
qualified_name
[
-
1
]
==
'<locals>'
,
self
.
qualified_name
self
.
qualified_name
.
pop
()
self
.
_set_qualname
(
node
)
else
:
self
.
_set_qualname
(
node
,
node
.
def_node
.
name
)
self
.
_set_qualname
(
node
,
node
.
def_node
.
name
)
self
.
visitchildren
(
node
)
self
.
visitchildren
(
node
)
self
.
qualified_name
=
orig_qualified_name
return
node
return
node
def
visit_DefNode
(
self
,
node
):
def
visit_DefNode
(
self
,
node
):
if
node
.
is_wrapper
and
self
.
qualified_name
:
assert
self
.
qualified_name
[
-
1
]
==
'<locals>'
,
self
.
qualified_name
orig_qualified_name
=
self
.
qualified_name
[:]
self
.
qualified_name
.
pop
()
self
.
_set_qualname
(
node
)
self
.
_super_visit_FuncDefNode
(
node
)
self
.
qualified_name
=
orig_qualified_name
else
:
self
.
_set_qualname
(
node
,
node
.
name
)
self
.
_set_qualname
(
node
,
node
.
name
)
return
self
.
visit_FuncDefNode
(
node
)
self
.
visit_FuncDefNode
(
node
)
return
node
def
visit_FuncDefNode
(
self
,
node
):
def
visit_FuncDefNode
(
self
,
node
):
orig_qualified_name
=
self
.
qualified_name
[:]
orig_qualified_name
=
self
.
qualified_name
[:]
...
...
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