X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=mimedecode.py;h=7604fb2dfb6104a2bd6349cbc36e730e19790e21;hb=0942670476d26cd86f81ddafe58fb48edfc9a39e;hp=0be095beb3cc21ac8fe8d594894af1b972916281;hpb=4e678ac9522dd6372854758bcb0c3f45d37b1df3;p=mimedecode.git diff --git a/mimedecode.py b/mimedecode.py index 0be095b..7604fb2 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -263,7 +263,7 @@ def decode_message(msg): if msg.is_multipart(): decode_multipart(msg) - elif msg.has_key("Content-Type"): # Simple one-part message - decode it + elif len(msg): # Simple one-part message (there are headers) - decode it decode_part(msg) else: # Not a message, just text - copy it literally output(msg.as_string())