diff options
author | Julien Duponchelle <julien@duponchelle.info> | 2017-12-19 12:23:17 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2017-12-19 12:23:17 (GMT) |
commit | 319c0345cdd8fddb49d235462e71883f1dd51b99 (patch) | |
tree | 5e684357737be745316522643f1f77da6b05269d /Lib/asyncio | |
parent | 36c2c044782997520df7fc5604742a615ccf6b17 (diff) | |
download | cpython-319c0345cdd8fddb49d235462e71883f1dd51b99.zip cpython-319c0345cdd8fddb49d235462e71883f1dd51b99.tar.gz cpython-319c0345cdd8fddb49d235462e71883f1dd51b99.tar.bz2 |
bpo-29711: Fix stop_serving in proactor loop kill all listening servers (#431)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/proactor_events.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index 915ad1a..7044437 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -536,6 +536,8 @@ class BaseProactorEventLoop(base_events.BaseEventLoop): self._accept_futures.clear() def _stop_serving(self, sock): - self._stop_accept_futures() + future = self._accept_futures.pop(sock.fileno(), None) + if future: + future.cancel() self._proactor._stop_serving(sock) sock.close() |