[Python-Dev] Need to hook Py_FatalError
James William Pye
python at jwp.name
Wed May 4 01:54:27 CEST 2005
On Tue, 2005-05-03 at 12:54 -0500, Jeff Epler wrote:
> On Tue, May 03, 2005 at 09:15:42AM -0700, Guido van Rossum wrote:
> > But tell me, what do you want the process to do instead of
> > terminating? Py_FatalError is used in situations where raising an
> > exception is impossible or would do more harm than good.
>
> In an application which embeds Python, I want to show the application's
> standard error dialog, which doesn't call any Python APIs (but does do
> things like capture the call stack at the time of the error). For this
> use, it doesn't matter that no further calls to those APIs are possible.
>
> Jeff
+1 Here.
In my case(postgresql), it would probably be wiser to map Py_Fatal's to
Postgres' ereport(FATAL,(...)), as it does appear to do some cleaning up
on exit, and if there's a remote user, it could actually give the user
the message.
[http://python.project.postgresql.org]
--
Regards, James William Pye
More information about the Python-Dev
mailing list