[issue13285] signal module ignores external signal changes

Jeroen Demeyer report at bugs.python.org
Wed Jan 16 08:00:50 EST 2019


Jeroen Demeyer <J.Demeyer at UGent.be> added the comment:

> In Jeroen's API, I can see what the Python-level signal handler is, but there's no way to find out whether that signal handler is actually in use or not.

I added support for that in the latest cysignals release. Now you can do

>>> import signal
>>> from cysignals.pysignals import getossignal, python_os_handler
>>> _ = signal.signal(signal.SIGINT, signal.default_int_handler)
>>> getossignal(signal.SIGINT) == python_os_handler
True

Note that cysignals is POSIX-only for now (it assumes sigaction), but the code could easily be ported to other systems. Ideally it would become part of CPython's signal module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue13285>
_______________________________________


More information about the Python-bugs-list mailing list