[Pythonmac-SIG] embedding issues

Jack Jansen jack@oratrix.nl
Mon, 27 Aug 2001 22:18:18 +0200


Recently, Jon Bradley <jbradley@whiplashmedia.com> said:
> Anyone have any suggestions to trapping exception calls when Python is
> embedded?  I'm having some serious problems if I try to execute a function
> or call and object that's not defined (or exists).  Presently, the embedded
> interpreter throws an exception and quits both the application and itself.

Jon,
you'll have to give a few more specifics. For instance, the terms
"exception calls", "function", and "not defined" can both refer to
Python or C, so it's difficult to answer the question without more
knowledge.

But, in general, if you're embedding only and you call PyEval_Call()
or some such, and a Python exception is raised somewhere in there,
Python should definitely not exit, it should simply return NULL.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.cwi.nl/~jack        | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm