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
1 changed files with 4 additions and 1 deletions

View File

@ -128,7 +128,10 @@ class TaskObject:
@asyncio.coroutine @asyncio.coroutine
def stop(self): def stop(self):
self.task.cancel() 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 del self.task
@asyncio.coroutine @asyncio.coroutine