From 1b9763d0a9c62c13dc2a06770032e5906b610c96 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Dec 2014 23:47:27 +0100 Subject: asyncio: sync with Tulip * Fix a race condition in BaseSubprocessTransport._try_finish(). If the process exited before the _post_init() method was called, scheduling the call to _call_connection_lost() with call_soon() is wrong: connection_made() must be called before connection_lost(). Reuse the BaseSubprocessTransport._call() method to schedule the call to _call_connection_lost() to ensure that connection_made() and connection_lost() are called in the correct order. * Add repr(PipeHandle) * Fix typo --- Lib/asyncio/windows_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/asyncio/windows_utils.py') diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py index 1155a77f346..c6e4bc9e46b 100644 --- a/Lib/asyncio/windows_utils.py +++ b/Lib/asyncio/windows_utils.py @@ -134,6 +134,13 @@ class PipeHandle: def __init__(self, handle): self._handle = handle + def __repr__(self): + if self._handle != -1: + handle = 'handle=%r' % self._handle + else: + handle = 'closed' + return '<%s %s>' % (self.__class__.__name__, handle) + @property def handle(self): return self._handle -- cgit v1.2.3