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