Skip to content

Commit c55fa12

Browse files
committed
Pre-declare disconnected flag
1 parent f92c52a commit c55fa12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tractor/_actor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,16 @@ async def _stream_handler(
571571
self._peers[uid].append(chan)
572572

573573
local_nursery: Optional[ActorNursery] = None # noqa
574+
disconnected: bool = False
574575

575576
# Begin channel management - respond to remote requests and
576577
# process received reponses.
577578
try:
578579
disconnected = await self._process_messages(chan)
579580

580-
except trio.Cancelled:
581+
except (
582+
trio.Cancelled,
583+
):
581584
log.cancel(f"Msg loop was cancelled for {chan}")
582585
raise
583586

0 commit comments

Comments
 (0)