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
Kirill Smelkov
cython
Commits
af67b788
Commit
af67b788
authored
Oct 22, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #250, Traceback method name is wrong for exceptions caught in methods
parent
ee9a0730
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-5
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+6
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+4
-2
No files found.
Cython/Compiler/Nodes.py
View file @
af67b788
...
...
@@ -1019,12 +1019,12 @@ class FuncDefNode(StatNode, BlockNode):
def
create_local_scope
(
self
,
env
):
genv
=
env
while
env
.
is_py_class_scope
or
env
.
is_c_class_scope
:
env
=
env
.
outer_scope
while
genv
.
is_py_class_scope
or
g
env
.
is_c_class_scope
:
g
env
=
env
.
outer_scope
if
self
.
needs_closure
:
lenv
=
GeneratorLocalScope
(
name
=
self
.
entry
.
name
,
outer_scope
=
genv
)
lenv
=
GeneratorLocalScope
(
name
=
self
.
entry
.
name
,
outer_scope
=
genv
,
parent_scope
=
env
)
else
:
lenv
=
LocalScope
(
name
=
self
.
entry
.
name
,
outer_scope
=
genv
)
lenv
=
LocalScope
(
name
=
self
.
entry
.
name
,
outer_scope
=
genv
,
parent_scope
=
env
)
lenv
.
return_type
=
self
.
return_type
type
=
self
.
entry
.
type
if
type
.
is_cfunction
:
...
...
@@ -2730,7 +2730,7 @@ class CClassDefNode(ClassDefNode):
buffer_defaults
=
buffer_defaults
)
if
home_scope
is
not
env
and
self
.
visibility
==
'extern'
:
env
.
add_imported_entry
(
self
.
class_name
,
self
.
entry
,
pos
)
scope
=
self
.
entry
.
type
.
scope
s
elf
.
scope
=
s
cope
=
self
.
entry
.
type
.
scope
if
scope
is
not
None
:
scope
.
directives
=
env
.
directives
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
af67b788
...
...
@@ -698,6 +698,12 @@ property NAME:
self
.
visitchildren
(
node
)
self
.
seen_vars_stack
.
pop
()
return
node
def
visit_ClassDefNode
(
self
,
node
):
self
.
env_stack
.
append
(
node
.
scope
)
self
.
visitchildren
(
node
)
self
.
env_stack
.
pop
()
return
node
def
visit_FuncDefNode
(
self
,
node
):
self
.
seen_vars_stack
.
append
(
set
())
...
...
Cython/Compiler/Symtab.py
View file @
af67b788
...
...
@@ -1066,8 +1066,10 @@ class ModuleScope(Scope):
class LocalScope(Scope):
def __init__(self, name, outer_scope):
Scope.__init__(self, name, outer_scope, outer_scope)
def __init__(self, name, outer_scope, parent_scope = None):
if parent_scope is None:
parent_scope = outer_scope
Scope.__init__(self, name, outer_scope, parent_scope)
def mangle(self, prefix, name):
return prefix + 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