Skip to content

Commit

Permalink
Set joined at end of finally clause, just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Booth committed Apr 25, 2021
1 parent 2b6b40a commit 82732ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiorpcx/curio.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ async def join(self):
and self.completed)):
return
finally:
self.joined = True
# Cancel everything but don't block
await self._cancel_tasks(self._pending.union(self.daemons), False)
# Ensure the event loop has processed the cancellations when we return
# This is mainly for no-surprises and cleanliness, including in the testsuite
await sleep(0)
self.joined = True

async def _cancel_tasks(self, tasks, blocking):
'''Cancel the passed set of tasks. Wait for them to complete if blocking.'''
Expand Down

0 comments on commit 82732ea

Please sign in to comment.