This usually means you're returning NULL for an object, or perhaps an
error code for a special method (without setting an error). Perhaps
some code would be helpful?
- Robert
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>()
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
Note that Robert M. said it made it down to a "return 0" line. So if
Cython is expecting a pointer back, but the program does "return 0",
then that would be equivalent to returning the NULL pointer, right?
Hopefully I'm not confusing the issue...
Thanks,
Jason
Yes, but NULL is only the error indicator for an object return type,
in which case 0 would be converted to a Python int.
Is the function in question declared as "except 0"?
- Robert
> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>