Thomas Kluyver added the comment:

I'd like to make the case for a fix in the code again. Our use case is, I 
believe, the same as Vilya's. We want to temporarily set a signal handler from 
Python and then restore the previous handler. This is fairly straightforward 
for Python handler functions, and SIG_DFL and SIG_IGN, but it breaks if 
anything has set a C level signal handler.

The opaque wrapper object is a solution that had occurred to me too. Another 
option would be a context manager implemented in C (I assume context managers 
can be written in C) which can set one or more signal handlers on entry, and 
restore them on exit.

----------
nosy: +takluyver

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to