summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/proactor_events.py
diff options
context:
space:
mode:
authortwisteroid ambassador <twisteroidambassador@users.noreply.github.com>2018-07-30 18:58:50 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2018-07-30 18:58:50 (GMT)
commit9045199c5aaeac9b52537581be127d999b5944ee (patch)
tree36e2ab26c69d390c0ec86edfb7612a98d9dbe8c9 /Lib/asyncio/proactor_events.py
parent6921ef7bef4eab3819b3d0fda5fa3e3b2a8c0613 (diff)
downloadcpython-9045199c5aaeac9b52537581be127d999b5944ee.zip
cpython-9045199c5aaeac9b52537581be127d999b5944ee.tar.gz
cpython-9045199c5aaeac9b52537581be127d999b5944ee.tar.bz2
bpo-33833: Fix ProactorSocketTransport AssertionError (#7893)
Diffstat (limited to 'Lib/asyncio/proactor_events.py')
-rw-r--r--Lib/asyncio/proactor_events.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index 6d230a2..66bfb0a 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -343,6 +343,10 @@ class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
def _loop_writing(self, f=None, data=None):
try:
+ if f is not None and self._write_fut is None and self._closing:
+ # XXX most likely self._force_close() has been called, and
+ # it has set self._write_fut to None.
+ return
assert f is self._write_fut
self._write_fut = None
self._pending_write = 0