Skip to content

Commit

Permalink
Fix #559 added missing braces (#560)
Browse files Browse the repository at this point in the history
- Subscribe calls may not be found so ok in read_loop
  • Loading branch information
robnagler authored Feb 5, 2025
1 parent e5714e7 commit cb4323d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pykern/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ def _unpack(msg):
if not (r := _unpack(m)):
break
if not (c := self._pending_calls.get(r.call_id)):
pkdlog("call_id={} not found reply={} {}", r.call_id, r, self)
break
pkdlog("call_id={} not found {}", r.call_id, self)
# May happen on subscriptions
continue
c.reply_put(r)
if not c.is_subscription or r.msg_kind.is_unsubscribe():
# Call is no longer valid for messages
Expand Down Expand Up @@ -255,7 +256,6 @@ def destroy(self):
else:
# Inferior to shutdown, but necessary pre-Python 3.13
self._reply_q.put_nowait(None)
self._call_id = None
self._client = None
self._reply_q = None

Expand Down Expand Up @@ -322,6 +322,7 @@ def __exit__(self, *args, **kwargs):
return False

def __repr__(self):
if self._destroyed:
return f"<self.__class__.__name__ DESTROYED>"
return f"<self.__class__.__name__ {self.api_name}#{self._call_id}>"
def _d():
return " DESTROYED" if self._destroyed else ""

return f"<{self.__class__.__name__} {self.api_name}#{self._call_id}{_d()}>"

0 comments on commit cb4323d

Please sign in to comment.