Open
Description
Enhancement
C signal handlers should be restore-able. Ideally you also want to call them from Python.
signal.signal(signal.SIGINT, signal.getsignal(signal.SIGINT))
This (ostensibly no-op) code raises TypeError when you use it in an embedded Python interpreter and a signal handler has been installed by the C (or whatever) side.
It shouldn't. My Python code wants to be able to restore the signal handler to its previous state when it's done.
Ideally my code should also be able to wrap that C handler, i.e. the result of getsignal() should be a callable from Python.