TaskScope parent is thrown into only if scope has terminated

This commit is contained in:
Mattia Giambirtone 2024-03-25 19:45:45 +01:00
parent b8cdeef41c
commit bfd494a2d7
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ class DefaultKernel(BaseKernel):
self._reschedule_scope_tree(scope)
self.release(task)
self.cancel_scope(scope)
if task is not scope.owner:
if task is not scope.owner and scope.done():
self.throw(scope.owner, task.exc)
def on_cancel(self, task: Task):