diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-08-25 23:08:51 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-08-25 23:08:51 +0200 |
| commit | afea3f26dc842bc7a66b4cd89a5bb8d48d7b6984 (patch) | |
| tree | 5ee569a9d268c28182ebeb0d9ef2e763cadc5a0b | |
| parent | cd7a6f4f24d5e4894682f2f0ce8a2bbe56d43323 (diff) | |
| download | trollius-git-afea3f26dc842bc7a66b4cd89a5bb8d48d7b6984.tar.gz | |
Tulip issue #200: _WaitHandleFuture._unregister_wait() now catchs and logs
exceptions.
| -rw-r--r-- | asyncio/windows_events.py | 13 |
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 |
