diff options
Diffstat (limited to 'Lib/asyncio/windows_events.py')
-rw-r--r-- | Lib/asyncio/windows_events.py | 12 |
1 files changed, 12 insertions, 0 deletions
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() |