Skip to content

Commit 752e632

Browse files
authored
Use pass for bytes instance check
1 parent eecbb58 commit 752e632

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@ def publish(self, topic, msg, retain=False, qos=0):
572572
msg = str(msg).encode("ascii")
573573
elif isinstance(msg, str):
574574
msg = str(msg).encode("utf-8")
575-
elif not isinstance(msg, bytes):
575+
elif isinstance(msg, bytes):
576+
pass
577+
else:
576578
raise MMQTTException("Invalid message data type.")
577579
if len(msg) > MQTT_MSG_MAX_SZ:
578580
raise MMQTTException("Message size larger than %d bytes." % MQTT_MSG_MAX_SZ)

0 commit comments

Comments
 (0)