File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -871,21 +871,19 @@ def unsubscribe(self, topic: str) -> None:
871
871
self .logger .debug ("Waiting for UNSUBACK..." )
872
872
while True :
873
873
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
+ )
889
887
890
888
def _recompute_reconnect_backoff (self ) -> None :
891
889
"""
You can’t perform that action at this time.
0 commit comments