On Tue, Feb 10, 2009 at 5:03 AM, Robert Bradshaw <[email protected]> wrote: > > I'm not sure this is the right fix, but it does appear to solve the > (serious) issue so we should include it and can optimize later. >
Indeed, the patch did not handle well all cases... My fix do not work well when cdef functions returning PyObject*, not sure at this point what to do. I've pushed two additions to tryfinally testcase, both fail :-( + + +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() -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
