Skip to content

Commit

Permalink
Merge pull request #432 from richardsheridan/wait_task_rescheduled_re…
Browse files Browse the repository at this point in the history
…turns

fix regression after trio 0.27.0 with explicit wait_task_rescheduled
  • Loading branch information
richardsheridan authored Oct 19, 2024
2 parents 3edcdb0 + 71f5b52 commit 35582a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ sortedcontainers==2.4.0
# via trio
tblib==3.0.0
# via -r requirements\install.in
trio==0.26.0
trio==0.27.0
# via -r requirements\install.in
6 changes: 5 additions & 1 deletion trio_parallel/_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ async def _aclose(self):
with trio.CancelScope(shield=True):
if self._lifetime.calc_running() != 0:
assert self is not get_default_context()
await trio.sleep_forever() # woken by self._lifetime.__aexit__

def abort_func(raise_cancel): # pragma: no cover
return trio.lowlevel.Abort.FAILED # never cancelled anyway

await trio.lowlevel.wait_task_rescheduled(abort_func)
await trio.to_thread.run_sync(
self._worker_cache.shutdown, self.grace_period
)
Expand Down

0 comments on commit 35582a0

Please sign in to comment.