Skip to content

Commit 31d7560

Browse files
committed
fix pylint
1 parent 572d6e1 commit 31d7560

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -871,21 +871,19 @@ def unsubscribe(self, topic: str) -> None:
871871
self.logger.debug("Waiting for UNSUBACK...")
872872
while True:
873873
op = self._wait_for_msg()
874-
if op:
875-
if op == 176:
876-
rc = self._sock_exact_recv(3)
877-
assert rc[0] == 0x02
878-
# [MQTT-3.32]
879-
assert rc[1] == packet_id_bytes[0] and rc[2] == packet_id_bytes[1]
880-
for t in topics:
881-
if self.on_unsubscribe is not None:
882-
self.on_unsubscribe(self, self._user_data, t, self._pid)
883-
self._subscribed_topics.remove(t)
884-
return
885-
else:
886-
raise MMQTTException(
887-
f"invalid message received as response to UNSUBSCRIBE: {hex(op)}"
888-
)
874+
if op == 176:
875+
rc = self._sock_exact_recv(3)
876+
assert rc[0] == 0x02
877+
# [MQTT-3.32]
878+
assert rc[1] == packet_id_bytes[0] and rc[2] == packet_id_bytes[1]
879+
for t in topics:
880+
if self.on_unsubscribe is not None:
881+
self.on_unsubscribe(self, self._user_data, t, self._pid)
882+
self._subscribed_topics.remove(t)
883+
else:
884+
raise MMQTTException(
885+
f"invalid message received as response to UNSUBSCRIBE: {hex(op)}"
886+
)
889887

890888
def _recompute_reconnect_backoff(self) -> None:
891889
"""

0 commit comments

Comments
 (0)