Skip to content

Commit

Permalink
Fix typo. Also, we only need parseaddr from email.utils
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigc committed Jun 14, 2017
1 parent 562496b commit 7561226
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/twisted/mail/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
import os
import random
import binascii
import email.utils
import warnings

from email.utils import parseaddr

from zope.interface import implementer

from twisted import cred
Expand Down Expand Up @@ -176,7 +177,7 @@ def quoteaddr(addr):
if isinstance(addr, bytes):
addr = addr.decode('ascii')

res = email.utils.parseaddr(addr)
res = parseaddr(addr)

if res == (None, None):
# It didn't parse, use it as-is
Expand Down Expand Up @@ -1896,7 +1897,7 @@ def __init__(self, fromEmail, toEmail, file, deferred, retries=5,
if not isinstance(_email, bytes):
_email = _email.encode('ascii')

toEmailFinal.append(email)
toEmailFinal.append(_email)
toEmail = toEmailFinal

self.fromEmail = Address(fromEmail)
Expand Down

0 comments on commit 7561226

Please sign in to comment.