From 180a1e42c8b840f489a79d0012cb9ee3d2aa08c3 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 10 Mar 2014 20:22:36 +0400 Subject: [PATCH] Remove str() calls No need to convert payloads to strings - non-multipart payloads are always strings. --- mimedecode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mimedecode.py b/mimedecode.py index c85bb8d..c12afbb 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -291,9 +291,9 @@ def decode_part(msg): encoding = msg["Content-Transfer-Encoding"] if left_binary or encoding in (None, '', '7bit', '8bit', 'binary'): - outstring = str(msg.get_payload()) + outstring = msg.get_payload() else: # Decode from transfer ecoding to text or binary form - outstring = str(msg.get_payload(decode=1)) + outstring = msg.get_payload(decode=1) set_header(msg, "Content-Transfer-Encoding", "8bit") msg["X-MIME-Autoconverted"] = "from %s to 8bit by %s id %s" % (encoding, gopts.host_name, me) -- 2.39.5