1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-10 06:48:19 +02:00

Modernize syntax, drop Python<3, drop Django<1.11

This commit is contained in:
Adam Dobrawy 2019-11-09 14:57:35 +01:00
parent d114008645
commit 84c99afa03
42 changed files with 176 additions and 330 deletions

View file

@ -1,19 +1,11 @@
import email
import six
# Do *not* remove this, we need to use this in subclasses of EmailTransport
if six.PY3:
from email.errors import MessageParseError # noqa: F401
else:
from email.Errors import MessageParseError # noqa: F401
from email.errors import MessageParseError # noqa: F401
class EmailTransport(object):
class EmailTransport:
def get_email_from_bytes(self, contents):
if six.PY3:
message = email.message_from_bytes(contents)
else:
message = email.message_from_string(contents)
message = email.message_from_bytes(contents)
return message