[Python-Dev] Tracebacks into C code

"Martin v. Löwis" martin at v.loewis.de
Sun Jan 11 14:00:19 EST 2004

Edward C. Jones wrote:
> Suppose:
>    I have a Python extension written in C.
>    "My_Func" is a function in the extension which is visible at the 
> Python level.
>    "My_Func" calls the C function "C_func1".
>    "C_func1" calls the C function "C_func2".
>    "C_func2" raises an exception by calling something like 
> "PyErr_SetString".
> How do I make the Python traceback include "C_func1" and "C_func2"?

You need to create frame objects. See Modules/pyexpat.c for an example.


P.S. This is OT for python-dev.

More information about the Python-Dev mailing list