asyncio: Add Transport.is_closing()

See https://github.com/python/asyncio/pull/291 for details.
This commit is contained in:
Yury Selivanov 2015-11-16 12:43:21 -05:00
parent da32d26ab9
commit 5bb1afb332
11 changed files with 36 additions and 14 deletions

View file

@ -302,7 +302,7 @@ class StreamWriter:
if exc is not None:
raise exc
if self._transport is not None:
if self._transport._closing:
if self._transport.is_closing():
# Yield to the event loop so connection_lost() may be
# called. Without this, _drain_helper() would return
# immediately, and code that calls