Message294400
| Author |
Mark.Shannon |
| Recipients |
Mark.Shannon, deleted0524, ncoghlan, njs, yselivanov |
| Date |
2017年05月24日.21:35:48 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1495661748.21.0.920779991171.issue29988@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
If all you need is that
with foo:
pass
guarantees that either both or neither of __enter__ and __exit__ are called, for C context managers, and only C context managers, then the fix is trivial.
To protect Python code would need a custom context manager wrapper
with ProtectsAgainstInterrupt(user_ctx_mngr()):
do_stuff()
ProtectsAgainstInterrupt would need to be implemented in C and install a custom signal handler. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2017年05月24日 21:35:48 | Mark.Shannon | set | recipients:
+ Mark.Shannon, ncoghlan, njs, yselivanov, deleted0524 |
| 2017年05月24日 21:35:48 | Mark.Shannon | set | messageid: <1495661748.21.0.920779991171.issue29988@psf.upfronthosting.co.za> |
| 2017年05月24日 21:35:48 | Mark.Shannon | link | issue29988 messages |
| 2017年05月24日 21:35:48 | Mark.Shannon | create |
|