patchbomb: use email.encoders instead of email.Encoders
authorAugie Fackler <augie@google.com>
Thu, 09 Aug 2018 18:28:19 -0400
changeset 39032 8979626089bb
parent 39031 2cf3bd4ae55e
child 39033 ed9537bd2d1a
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
hgext/patchbomb.py
--- 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)]