Re: [Orbit-python-list] Catching SIGINT inside orb.run()
Status: Inactive
Brought to you by:
tack
From: Christian R. R. <ki...@as...> - 2000-12-05 00:28:45
|
On Thu, 30 Nov 2000, Jason Tackaberry wrote: > I don't _think_ so. From what I can see in signalmodule.c, when you set > a custom handler using signal.signal(), it stores the Python function in > an array (line 256 of signalmodule.c, v1.5.2) after calling signal(2) > and setting the signal handler to the stub function signal_handler > (lines 249 and 245). It does, but AFAICS Handlers is opaque (declared as static) and can't be accessed by external modules. So we're hitched because we can't set tripped. I'm wondering if we can use PyOS_getsig() and call the signal manually. I'm checking. > So when you call signal(2) yourself, you're just skipping the signal > module's stub function (signal_handler) in place of your own, both of > which will call PyErr_CheckSignals (line 142). PyErr_CheckSignals loops > through that array (lines 628-644) and calls the Python functions that > were set using signal.signal(). Yeah, and poisoning the array seems to be the only thing I would need to do, if everything wasn't declared static :-) Still trying. Take care, -- /\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil ~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311 |