forked from mirror/django-mailbox
Modernize syntax, drop Python EOL, drop drop Django<1.11, upgrade TravisCI config to v1, add Python 3.8 & Django 3.x
This commit is contained in:
parent
f9b0a27e5f
commit
2b2b7d6392
43 changed files with 228 additions and 349 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue