]> git.phdru.name Git - mimedecode.git/commitdiff
Remove str() calls
authorOleg Broytman <phd@phdru.name>
Mon, 10 Mar 2014 16:22:36 +0000 (20:22 +0400)
committerOleg Broytman <phd@phdru.name>
Mon, 10 Mar 2014 16:22:36 +0000 (20:22 +0400)
No need to convert payloads to strings - non-multipart payloads are
always strings.

mimedecode.py

index c85bb8dbe89fe048fd320f1f94b2341e000ce514..c12afbb963bcdd60eeaee789d6de8848d8ee1a26 100755 (executable)
@@ -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)