handling exception of python callback called from C function

Harald Kirsch kirschh at lionbioscience.com
Mon Apr 22 04:59:35 EDT 2002


I have a C library which runs callbacks into user-supplied code. I
made a python extension to interface this library in a way that such a
callback ends up again in the extension which then executes python
scripts.

The following can happen:

1) the script code called via the callback throws an exception,

2) the extension catches the exception and translates it into an error
code for the calling C function,

3) the C function recognizes the error code and returns with its own
error code to the calling interfacing python extension,

4) the interfacing python extension recognizes the error code. It can
even identify the fact that the cause of the error was a
python-exception.

QUESTION:

How can step (4) initialize/augment the error traceback with the
traceback information generated in step (1)?

  Harald Kirsch

-- 
----------------+------------------------------------------------------
Harald Kirsch   | kirschh bei lionbioscience punkt com
       *** Please do not send me copies of your posts. ***



More information about the Python-list mailing list