Browse Source

handle correctly non-bytes messages - PYADAPT52

master
David 6 years ago
parent
commit
65a573ad6a
  1. 7
      test/miniimap.py

7
test/miniimap.py

@ -21,8 +21,11 @@ def connect():
def bytesmessage_to_string(msg): def bytesmessage_to_string(msg):
"converts bytes-like message to string" "converts bytes-like message to string"
msg = msg.decode("UTF-8").rstrip() if type(msg) is bytes:
return msg msg = msg.decode("UTF-8").rstrip()
return msg
else:
return str(msg)
def send(inbox, msg): def send(inbox, msg):
"send msg to inbox in MIME format" "send msg to inbox in MIME format"

Loading…
Cancel
Save