2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

tools/TaskObject: do not suppress exceptions raised by terminating task

This commit is contained in:
Sebastien Bourdeauducq 2015-08-06 22:14:49 +08:00
parent 705ec6ba04
commit e078dabd3c

View File

@ -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