# HG changeset patch # User Augie Fackler # Date 2018-08-09 22:28:19 # Node ID 8979626089bb6442fd05c659d6b4d7724e689798 # Parent 2cf3bd4ae55e0b98282e2e490d3c3d5cabedd5c2 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 diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -73,7 +73,7 @@ You can set patchbomb to always ask for ''' 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 @@ def _getbundlemsgs(repo, sender, bundle, 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)]