[IPython-dev] Ctrl-C quitting ipython

Fernando Perez fperez.net@gmail....
Thu Nov 4 01:17:50 CDT 2010


On Wed, Nov 3, 2010 at 12:01 PM, Robert Kern <robert.kern@gmail.com> wrote:
>
> You can get any Python-installed handler using signal.getsignal(signal.SIGINT).
> I don't know if you can determine C-installed handlers. Would you mind reverting

No, you can't, unfortunately:

http://svn.python.org/view/python/branches/release27-maint/Modules/signalmodule.c?revision=85145&view=markup

if you scroll down to getsignal, you'll see that it just reads from a
global table it keeps, which is filled by signal().  A C-installed
handler can call the raw PyOS_setsig() without updating the table, and
getsignal() will be none the wiser.

Cheers,

f


More information about the IPython-dev mailing list