task group: set done if empty
This commit is contained in:
parent
fddb0c9e66
commit
1cdb4bc9e7
1 changed files with 2 additions and 0 deletions
|
@ -23,3 +23,5 @@ class TaskGroup:
|
|||
def cancel(self):
|
||||
for task in self._tasks:
|
||||
task.cancel()
|
||||
if len(self._tasks) < 1:
|
||||
self.done.set()
|
||||
|
|
Loading…
Reference in a new issue