summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/windows_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-12 01:11:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-12 01:11:53 (GMT)
commite912e652f85bfd92d7209aa0cb23e5d3975a8d72 (patch)
tree9bd5327f26baf131749e46842ea038690914e369 /Lib/asyncio/windows_events.py
parent8ebeb03740dad4d9edd65de88f82840a05070941 (diff)
downloadcpython-e912e652f85bfd92d7209aa0cb23e5d3975a8d72.zip
cpython-e912e652f85bfd92d7209aa0cb23e5d3975a8d72.tar.gz
cpython-e912e652f85bfd92d7209aa0cb23e5d3975a8d72.tar.bz2
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.
Diffstat (limited to 'Lib/asyncio/windows_events.py')
-rw-r--r--Lib/asyncio/windows_events.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 93b71b2..9d86c96 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()