From 608d747b32686bfdeefae206810f17f72a2c82b5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 29 Jul 2014 11:36:00 +0200 Subject: _WaitHandleFuture and _OverlappedFuture: hide frames of internal calls in the source traceback. --- asyncio/windows_events.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/asyncio/windows_events.py b/asyncio/windows_events.py index 1db255e..a5d9b21 100644 --- a/asyncio/windows_events.py +++ b/asyncio/windows_events.py @@ -83,6 +83,8 @@ class _WaitHandleFuture(futures.Future): def __init__(self, handle, wait_handle, *, loop=None): super().__init__(loop=loop) + if self._source_traceback: + del self._source_traceback[-1] self._handle = handle self._wait_handle = wait_handle @@ -399,6 +401,8 @@ class IocpProactor: wh = _overlapped.RegisterWaitWithQueue( handle, self._iocp, ov.address, ms) f = _WaitHandleFuture(handle, wh, loop=self._loop) + if f._source_traceback: + del f._source_traceback[-1] def finish_wait_for_handle(trans, key, ov): # Note that this second wait means that we should only use @@ -431,6 +435,8 @@ class IocpProactor: # operation when it completes. The future's value is actually # the value returned by callback(). f = _OverlappedFuture(ov, loop=self._loop) + if f._source_traceback: + del f._source_traceback[-1] if not ov.pending and not wait_for_post: # The operation has completed, so no need to postpone the # work. We cannot take this short cut if we need the -- cgit v1.2.1