Message285831
| Author |
takluyver |
| Recipients |
flox, martin.panter, neologix, petri.lehtinen, pitrou, rpcope1, takluyver, vilya, vstinner |
| Date |
2017年01月19日.18:49:49 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1484851789.77.0.767448156201.issue13285@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|