Guido van Rossum wrote:Hum, I guess I'm missing something, but futures don't have a stop() method. The code already calls loop.stop() when the future is done.
Yeah, I think the base implementation of run_until_complete is wrong.
I think I didn't have stop() when I coded that.
Could you change it to something that just registers a lambda calling
stop() on the Future, and see if that makes your test case behave
better? (If so, please add a unit test and submit for code review.)
What I had in mind was to add a _called to Handler and expose it with a readonly property, so then we could check if handler.called and raise TimeoutError or not. As for raising another exception, maybe it's not such a good idea, since caller can always check future.done() later anyway.