From 65a573ad6a1683383b3f72ceb92fd06372d4b14a Mon Sep 17 00:00:00 2001 From: David Date: Thu, 21 Nov 2019 12:33:05 +0100 Subject: [PATCH] handle correctly non-bytes messages - PYADAPT52 --- test/miniimap.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/miniimap.py b/test/miniimap.py index 4ca9049..b34b294 100644 --- a/test/miniimap.py +++ b/test/miniimap.py @@ -21,8 +21,11 @@ def connect(): def bytesmessage_to_string(msg): "converts bytes-like message to string" - msg = msg.decode("UTF-8").rstrip() - return msg + if type(msg) is bytes: + msg = msg.decode("UTF-8").rstrip() + return msg + else: + return str(msg) def send(inbox, msg): "send msg to inbox in MIME format"