Patchwork D2453: py3: use email.utils module instead of email.Utils

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 6:53 p.m.
Message ID <d88716912523bbd00c184ee7f6b5126a@localhost.localdomain>
Download mbox | patch
Permalink /patch/28416/
State Not Applicable
Headers show

Comments

phabricator - Feb. 26, 2018, 6:53 p.m.
pulkit updated this revision to Diff 6129.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2453?vs=6108&id=6129

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

AFFECTED FILES
  hgext/patchbomb.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -75,6 +75,7 @@ 
 
 import email as emailmod
 import email.generator as emailgen
+import email.utils as eutil
 import errno
 import os
 import socket
@@ -745,7 +746,7 @@ 
         if not parent.endswith('>'):
             parent += '>'
 
-    sender_addr = emailmod.Utils.parseaddr(sender)[1]
+    sender_addr = eutil.parseaddr(sender)[1]
     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
     sendmail = None
     firstpatch = None
@@ -764,7 +765,7 @@ 
             parent = m['Message-Id']
 
         m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version()
-        m['Date'] = emailmod.Utils.formatdate(start_time[0], localtime=True)
+        m['Date'] = eutil.formatdate(start_time[0], localtime=True)
 
         start_time = (start_time[0] + 1, start_time[1])
         m['From'] = sender