Print a traceback from an extension?

gb at cs.unc.edu gb at cs.unc.edu
Sat Jul 13 19:18:12 EDT 2002


Can I print a traceback from within a extension written in C? 

I know we're supposed to just keep returning NULL until we make it
back to the main loop. That normally works fine. 

But I'm calling Python code from a callback that is called by C
code. The Python code fails so PyEval_CallObject returns NULL. I want
to provide a helpful message at that point.

Can this be done? If so, can someone suggest where to look for an
example?

Thanks
gb



More information about the Python-list mailing list