Commit e4f6e4ca authored by Lisandro Dalcin's avatar Lisandro Dalcin

extend tryfinally testcase

parent e908c0b9
...@@ -29,6 +29,8 @@ TypeError ...@@ -29,6 +29,8 @@ TypeError
3 3
>>> try_continue(3) >>> try_continue(3)
3 3
>>> try_return_none_1()
>>> try_return_none_2()
""" """
def finally_except(): def finally_except():
...@@ -59,3 +61,25 @@ def try_continue(a): ...@@ -59,3 +61,25 @@ def try_continue(a):
finally: finally:
i+=1 i+=1
return i 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()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment