You seem to have misunderstood me here. I am not trying to suppress the exception. I am trying to make sure that the programmer gets the correct exception (TypeError) handed to them.

The Python C interface documentation is pretty clear on this point. You MUST return NULL instead of a PyObject* when your C code has set an exception. The resulting SystemError, on top of the TypeError the calling Python code should be getting, is a pretty clear and unequivocal demonstration of this, and it even says what's wrong ("SystemError: returned a result with an exception set"). See my bug report for the example stack trace.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/4044/c2508915041@github.com>