Re: [Python-ideas] IDEA: do not alter default SIGINT handling

Benjamin Peterson writes:
Sure. But setting things up so that C-c doesn't even get through to the program doesn't help that cause. Since the OP claims it works for him, maybe the "IDEA" has merit in some more limited form, for example, by default uninstalling the Python graceful_SIGINT_handler when calling into a C module. (Probably this would have to be introduced in stages to allow extensions to update their functions as needed -- I suppose this would be a performance hit.) Then you could provide a with-signal-handler form of the standard macro for defining a Python function, with the semantics that the signal handler change gets optimized away if you specify the standard handler. And document that in this form the function needs to handle the SIGINT_signaled flag (or however it works) itself, or accept the possibility of an uninterruptible hang.
participants (1)
-
Stephen J. Turnbull