projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e908c0b
)
extend tryfinally testcase
author
Lisandro Dalcin
<dalcinl@gmail.com>
Tue, 10 Feb 2009 13:17:08 +0000
(11:17 -0200)
committer
Lisandro Dalcin
<dalcinl@gmail.com>
Tue, 10 Feb 2009 13:17:08 +0000
(11:17 -0200)
tests/run/tryfinally.pyx
patch
|
blob
|
history
diff --git
a/tests/run/tryfinally.pyx
b/tests/run/tryfinally.pyx
index 871546d605cf8a81738d3df33d62e4e49141f1d7..37a67bd6ea639ff09e8d3b476e3faebecb4abf9b 100644
(file)
--- a/
tests/run/tryfinally.pyx
+++ b/
tests/run/tryfinally.pyx
@@
-29,6
+29,8
@@
TypeError
3
>>> try_continue(3)
3
+>>> try_return_none_1()
+>>> try_return_none_2()
"""
def finally_except():
@@
-59,3
+61,25
@@
def try_continue(a):
finally:
i+=1
return i
+
+
+def try_return_none_1():
+ try:
+ return
+ finally:
+ return
+
+cdef extern from *:
+ ctypedef struct PyObject
+ void Py_INCREF(object)
+
+cdef PyObject* _none():
+ ret = None
+ Py_INCREF(ret)
+ return <PyObject*> ret
+
+def try_return_none_2():
+ try:
+ return <object> _none()
+ finally:
+ return <object> _none()