-
-
Notifications
You must be signed in to change notification settings - Fork 178
Conversation
First pass at treating all exceptions in an event loop as equal.
BaseExceptions like KeyboardInterrupt are not raised by run_forever.
Grammar fix and removal of outdated comment.
Can you please elaborate the use case? Do you want to catch all base
exceptions? Or only KeyboardInterrupt?
Why not setting a handler for SIGINT signal to catch KeyboardInterrupt in
the regular adyncio control flow?
|
There was some discussion on the python-tulip list. See also IMO the main problem with the existing approach (catching Exception and The signal solution is indeed nicer, because it ensures that interrupts are I don't really think that catching BaseException everywhere we currently On Sun, Jan 3, 2016 at 2:37 AM, Victor Stinner notifications@github.com
--Guido van Rossum (python.org/~guido) |
2016-01-03 22:12 GMT+01:00 Guido van Rossum notifications@github.com:
The C signal handler is always called immediatly, but the Victor |
On Mon, Jan 4, 2016 at 12:45 AM, Victor Stinner notifications@github.com
But such things happen all the time, by accident or while people are --Guido van Rossum (python.org/~guido) |
Another use case was found in Hypothesis testing library: HypothesisWorks/hypothesis#292 (comment) |
I'm going to close this PR. First it's fairly outdates. Second, we aren't sure that we have a problem with |
Prior to this patch the event loop was only intended to handle Exception. BaseException exceptions would break out of the event loop (mostly). This patch treats all exceptions equally so application code can throw BaseException and its derivatives.
Created this at Guido's request..
ref: https://groups.google.com/forum/#!topic/python-tulip/QK7oDGJwhXg