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
58924d46
Commit
58924d46
authored
May 08, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chain exception in finally clause
parent
9fb77985
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
Cython/Compiler/FlowControl.py
Cython/Compiler/FlowControl.py
+3
-0
tests/errors/w_uninitialized_exc.pyx
tests/errors/w_uninitialized_exc.pyx
+13
-0
No files found.
Cython/Compiler/FlowControl.py
View file @
58924d46
...
...
@@ -824,6 +824,9 @@ class CreateControlFlowGraph(CythonTransform):
self
.
flow
.
block
=
entry_point
self
.
visit
(
node
.
finally_clause
)
if
self
.
flow
.
block
and
self
.
flow
.
exceptions
:
self
.
flow
.
block
.
add_child
(
self
.
flow
.
exceptions
[
-
1
].
entry_point
)
# Normal execution
finally_enter
=
self
.
flow
.
newblock
()
self
.
flow
.
block
=
finally_enter
...
...
tests/errors/w_uninitialized_exc.pyx
View file @
58924d46
...
...
@@ -100,6 +100,18 @@ def try_finally(a):
finally
:
return
x
def
try_finally_nested
(
m
):
try
:
try
:
try
:
f
=
m
()
except
:
pass
finally
:
pass
except
:
print
f
_ERRORS
=
"""
12:12: local variable 'e' might be referenced before assignment
12:15: local variable 'i' might be referenced before assignment
...
...
@@ -109,4 +121,5 @@ _ERRORS = """
77:14: local variable 'oops' might be referenced before assignment
93:16: local variable 'x' might be referenced before assignment
101:16: local variable 'x' might be referenced before assignment
113:15: local variable 'f' might be referenced before assignment
"""
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