Patchwork D2168: mail: import email.utils not email.Utils

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 2:48 a.m.
Message ID <4f89b87565c4463ddbbb6ccda6cdcafb@localhost.localdomain>
Download mbox | patch
Permalink /patch/27770/
State Not Applicable
Headers show

Comments

phabricator - Feb. 13, 2018, 2:48 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG54dfb65e2f82: mail: import email.utils not email.Utils (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2168?vs=5469&id=5591

REVISION DETAIL
  https://phab.mercurial-scm.org/D2168

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -288,13 +288,13 @@ 
             addr = addr.encode('ascii')
         except UnicodeDecodeError:
             raise error.Abort(_('invalid local address: %s') % addr)
-    return email.Utils.formataddr((name, addr))
+    return email.utils.formataddr((name, addr))
 
 def addressencode(ui, address, charsets=None, display=False):
     '''Turns address into RFC-2047 compliant header.'''
     if display or not address:
         return address or ''
-    name, addr = email.Utils.parseaddr(address)
+    name, addr = email.utils.parseaddr(address)
     return _addressencode(ui, name, addr, charsets)
 
 def addrlistencode(ui, addrs, charsets=None, display=False):
@@ -305,7 +305,7 @@ 
         return [a.strip() for a in addrs if a.strip()]
 
     result = []
-    for name, addr in email.Utils.getaddresses(addrs):
+    for name, addr in email.utils.getaddresses(addrs):
         if name or addr:
             result.append(_addressencode(ui, name, addr, charsets))
     return result