From 80d05fdbc3f4ff706eff5a058eee7c72722e4418 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Sat, 13 Feb 2021 01:09:07 +0200 Subject: [PATCH] MQTT library: check for None return from recv(). * Makes it work with different sockets implementations. --- scripts/libraries/mqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/libraries/mqtt.py b/scripts/libraries/mqtt.py index f07ae32d8..372b72827 100644 --- a/scripts/libraries/mqtt.py +++ b/scripts/libraries/mqtt.py @@ -167,7 +167,7 @@ class MQTTClient: # messages processed internally. def wait_msg(self): res = self.sock.read(1) - if res == b"": + if res == b"" or res == None: return None self.sock.setblocking(True) if res == b"\xd0": # PINGRESP