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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
bc82e78e
Commit
bc82e78e
authored
Nov 26, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
2a6bfe21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
tests/run/tryfinally.pyx
tests/run/tryfinally.pyx
+23
-0
No files found.
tests/run/tryfinally.pyx
View file @
bc82e78e
...
@@ -9,6 +9,9 @@ TypeError
...
@@ -9,6 +9,9 @@ TypeError
Traceback (most recent call last):
Traceback (most recent call last):
TypeError
TypeError
>>> call_try_return_with_exception()
1
>>> def try_return_py():
>>> def try_return_py():
... try:
... try:
... return 1
... return 1
...
@@ -18,6 +21,8 @@ TypeError
...
@@ -18,6 +21,8 @@ TypeError
2
2
>>> try_return_cy()
>>> try_return_cy()
2
2
>>> call_try_return_c()
2
>>> i=1
>>> i=1
>>> for i in range(3):
>>> for i in range(3):
...
@@ -46,6 +51,24 @@ def try_return_cy():
...
@@ -46,6 +51,24 @@ def try_return_cy():
finally
:
finally
:
return
2
return
2
cdef
int
try_return_c
():
try
:
return
1
finally
:
return
2
def
call_try_return_c
():
return
try_return_c
()
cdef
int
try_return_with_exception
():
try
:
raise
TypeError
finally
:
return
1
def
call_try_return_with_exception
():
return
try_return_with_exception
()
def
try_return_temp
(
a
):
def
try_return_temp
(
a
):
b
=
a
+
2
b
=
a
+
2
try
:
try
:
...
...
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