From e912e652f85bfd92d7209aa0cb23e5d3975a8d72 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 12 Jul 2014 03:11:53 +0200 Subject: asyncio: sync with Tulip * Tulip issue #183: log socket events in debug mode - Log most important socket events: socket connected, new client, connection reset or closed by peer (EOF), etc. - Log time elapsed in DNS resolution (getaddrinfo) - Log pause/resume reading - Log time of SSL handshake - Log SSL handshake errors - Add a __repr__() method to many classes * Fix ProactorEventLoop() in debug mode. ProactorEventLoop._make_self_pipe() doesn't call call_soon() directly because it checks for the current loop which fails, because the method is called to build the event loop. * Cleanup _ProactorReadPipeTransport constructor. Not need to set again _read_fut attribute to None, it is already done in the base class. --- Lib/asyncio/windows_events.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Lib/asyncio/windows_events.py') diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py index 93b71b2a13e..9d86c96bc15 100644 --- a/Lib/asyncio/windows_events.py +++ b/Lib/asyncio/windows_events.py @@ -40,6 +40,18 @@ class _OverlappedFuture(futures.Future): super().__init__(loop=loop) self.ov = ov + def __repr__(self): + info = [self._state.lower()] + if self.ov.pending: + info.append('overlapped=pending') + else: + info.append('overlapped=completed') + if self._state == futures._FINISHED: + info.append(self._format_result()) + if self._callbacks: + info.append(self._format_callbacks()) + return '<%s %s>' % (self.__class__.__name__, ' '.join(info)) + def cancel(self): try: self.ov.cancel() -- cgit v1.2.3