From df16a0c315b537661d29f87f411871abfbe73e65 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 16 Feb 2022 13:09:05 -0500 Subject: [PATCH] Pre-declare disconnected flag --- tractor/_actor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tractor/_actor.py b/tractor/_actor.py index 1dfabef..ad83966 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -571,13 +571,16 @@ class Actor: self._peers[uid].append(chan) local_nursery: Optional[ActorNursery] = None # noqa + disconnected: bool = False # Begin channel management - respond to remote requests and # process received reponses. try: disconnected = await self._process_messages(chan) - except trio.Cancelled: + except ( + trio.Cancelled, + ): log.cancel(f"Msg loop was cancelled for {chan}") raise