Skip to content

Commit

Permalink
Use pass for bytes instance check
Browse files Browse the repository at this point in the history
  • Loading branch information
PhearZero authored Jul 7, 2021
1 parent 9bad870 commit 58a4421
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,9 @@ def publish(self, topic, msg, retain=False, qos=0):
msg = str(msg).encode("ascii")
elif isinstance(msg, str):
msg = str(msg).encode("utf-8")
elif not isinstance(msg, bytes):
elif isinstance(msg, bytes):
pass
else:
raise MMQTTException("Invalid message data type.")
if len(msg) > MQTT_MSG_MAX_SZ:
raise MMQTTException("Message size larger than %d bytes." % MQTT_MSG_MAX_SZ)
Expand Down

0 comments on commit 58a4421

Please sign in to comment.