tracebacks in embedded python
Thomas Heller
theller at python.net
Wed Jul 9 11:38:23 EDT 2003
mmueller at dgfz.de (Mike Müller) writes:
> When I embed Python into C there is no traceback message on the screen
> after an uncaught exception. Using sys.exc_info() I can print may own
> traceback but I would need to insert try except statements at
> different places. Is there a way to "turn on" traceback writing to
> std.err (that also shows up at the screen)?
You should check the return value of the Python API call for failure.
Most functions return NULL or -1 on error.
Then you call PyErr_Print().
Thomas
More information about the Python-list
mailing list