+10
−36
Loading
* In the various `wait_done` methods, don't await potentially-cancelled tasks. Awaiting cancelled tasks in python is generally considered bad practice, and more concretely it's tricky to correctly determine whether a caught CancelledError while awaiting such a task is a result of *our* task being cancelled, in which case it should be re-raised. Previously we were swallowing these, which may have prevented the rest of cancellation from being handled properly. For these what we really care about are that the sockets are fully closed, so we just await that directly. * In places where we want to catch and re-raise all exceptions, use BaseException instead of Exception. In particular CancelledError is a BaseException but not an Exception. This fixes the asyncio warnings about un-retrieved task errors after the test times out and is cancelled.