Skip to content

Commit

Permalink
No such thing as bytes in Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortal committed May 1, 2015
1 parent 911f831 commit 39c1ef6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion emailtunnel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def __init__(self, message=None):
if message:
assert isinstance(message, bytes)

self.message = email.message_from_bytes(message)
if six.PY3:
self.message = email.message_from_bytes(message)
else:
self.message = email.message_from_string(message)

if not self._sanity_check(message):
self._sanity_log_invalid(message)
Expand Down

0 comments on commit 39c1ef6

Please sign in to comment.