bpo-23325: Turn signal.SIG_DFL and signal.SIG_IGN into functions. by serhiy-storchaka · Pull Request #8920 · python/cpython
Why should SIG_IGN raise an error when called instead of doing nothing, which is what happens when SIG_IGN is actually supplied as a signal handler?
Why should SIG_IGN raise an error when called instead of doing nothing, which is what happens when SIG_IGN is actually supplied as a signal handler?
Because currently calling SIG_IGN() raises a TypeError. But I agree, we can make it callable.
Hmm, the problem is this will break code such as:
handler = signal.getsignal(signum) if callable(handler): # Do something, e.g. call the handler
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has merge conflicts now.
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters