On Fri, Feb 25, 2011 at 1:07 AM, Tom Boothby <tomas.boot...@gmail.com> wrote:
> FWIW, I get that error message on the following:
>
> sage: cython("""
> cdef int foo(int z) except -1:
>    return z
>
> def bar(z):
>    return foo(z)
> """)
> sage: bar(-1)
> ---------------------------------------------------------------------------
> SystemError                               Traceback (most recent call last)
>
> /home/tom/sage-4.6.2.rc0/<ipython console> in <module>()
>
> SystemError: error return without exception set

Yep. You have to write "except? -1" if -1 is a valid non-error return
value. 
http://docs.cython.org/src/userguide/language_basics.html#error-return-values

- Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to