summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-08-25 23:08:51 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-08-25 23:08:51 +0200
commit1a886575b44e30c8777da825e7a0a741d4ae31ab (patch)
tree5ee569a9d268c28182ebeb0d9ef2e763cadc5a0b
parentf0528c3da86c2df819211bc3ca0829fcdf079a39 (diff)
downloadtrollius-1a886575b44e30c8777da825e7a0a741d4ae31ab.tar.gz
Tulip issue #200: _WaitHandleFuture._unregister_wait() now catchs and logs
exceptions.
-rw-r--r--asyncio/windows_events.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/asyncio/windows_events.py b/asyncio/windows_events.py
index 66aeca8..6881789 100644
--- a/asyncio/windows_events.py
+++ b/asyncio/windows_events.py
@@ -111,10 +111,17 @@ class _WaitHandleFuture(futures.Future):
return
try:
_overlapped.UnregisterWait(self._wait_handle)
- except OSError as e:
- if e.winerror != _overlapped.ERROR_IO_PENDING:
- raise
+ except OSError as exc:
# ERROR_IO_PENDING is not an error, the wait was unregistered
+ if exc.winerror != _overlapped.ERROR_IO_PENDING:
+ context = {
+ 'message': 'Failed to unregister the wait handle',
+ 'exception': exc,
+ 'future': self,
+ }
+ if self._source_traceback:
+ context['source_traceback'] = self._source_traceback
+ self._loop.call_exception_handler(context)
self._wait_handle = None
self._iocp = None
self._ov = None