From e078dabd3c6b4621e1e83ee0720a8464b3ead66e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 6 Aug 2015 22:14:49 +0800 Subject: [PATCH] tools/TaskObject: do not suppress exceptions raised by terminating task --- artiq/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/tools.py b/artiq/tools.py index 767e858dd..c6db084a9 100644 --- a/artiq/tools.py +++ b/artiq/tools.py @@ -128,7 +128,10 @@ class TaskObject: @asyncio.coroutine def stop(self): self.task.cancel() - yield from asyncio.wait([self.task]) + try: + yield from asyncio.wait_for(self.task, None) + except asyncio.CancelledError: + pass del self.task @asyncio.coroutine