changeset 39032:8979626089bb

patchbomb: use email.encoders instead of email.Encoders No idea when this became a thing, but it exists for me in both 2.7 and 3.6. Differential Revision: https://phab.mercurial-scm.org/D4222
author Augie Fackler <augie@google.com>
date Thu, 09 Aug 2018 18:28:19 -0400
parents 2cf3bd4ae55e
children ed9537bd2d1a
files hgext/patchbomb.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Thu Aug 09 18:27:36 2018 -0400
+++ b/hgext/patchbomb.py	Thu Aug 09 18:28:19 2018 -0400
@@ -73,7 +73,7 @@
 '''
 from __future__ import absolute_import
 
-import email as emailmod
+import email.encoders as emailencoders
 import email.generator as emailgen
 import email.mime.base as emimebase
 import email.mime.multipart as emimemultipart
@@ -380,7 +380,7 @@
     bundlename = '%s.hg' % opts.get(r'bundlename', 'bundle')
     datapart.add_header('Content-Disposition', 'attachment',
                         filename=bundlename)
-    emailmod.Encoders.encode_base64(datapart)
+    emailencoders.encode_base64(datapart)
     msg.attach(datapart)
     msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get(r'test'))
     return [(msg, subj, None)]