bpo-36916: asyncio: Swallow unhandled write() exception (GH-13313)

This commit is contained in:
Andrew Svetlov 2019-05-14 19:09:44 +03:00 committed by Victor Stinner
parent c96be811fa
commit f12ba7cd0a
3 changed files with 15 additions and 1 deletions

View file

@ -851,6 +851,8 @@ os.close(fd)
# where it never gives up the event loop but the socket is
# closed on the server side.
messages = []
self.loop.set_exception_handler(lambda loop, ctx: messages.append(ctx))
q = queue.Queue()
def server():
@ -883,6 +885,7 @@ os.close(fd)
# Clean up the thread. (Only on success; on failure, it may
# be stuck in accept().)
thread.join()
self.assertEqual([], messages)
def test___repr__(self):
stream = asyncio.StreamReader(loop=self.loop,