[Pythonmac-SIG] PyObjC and signal handling

Vinay Sajip vinay_sajip at yahoo.co.uk
Mon Aug 29 14:00:23 CEST 2011


How does PyObjC deal with signals received by an application? If I run a
windowed PyObjC application, I can't interrupt it with Ctrl-C (this is on
Leopard). I know this is no big deal, since I can always use Cmd-., but there
are instances where a signal might be sent programmatically to a process. In
such cases, a Python-installed signal handler would not be invoked if the
application is inside C code waiting for events, until it returns from C back to
Python code - potentially a long delay if no other events arrive for a while.

There appears to be code in the PyObjC codebase to deal with it (e.g.
installMachInterrupt) but I can't see how it gets called. It appears to use a
C-level library called _machsignals, which I can't find on the system. Is this
particular functionality in PyObjC no longer used?

Thanks for any pointers,

Vinay Sajip



More information about the Pythonmac-SIG mailing list