Mercurial > hg
diff hgext/patchbomb.py @ 38472:d17d1ee1d602
patchbomb: use email.mime.base instead of email.MIMEBase
The later was removed on Python 3.
On python 2:
>>> email.MIMEBase.MIMEBase is email.mime.base.MIMEBase
True
Differential Revision: https://phab.mercurial-scm.org/D3836
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 26 Jun 2018 02:05:11 +0530 |
parents | 91228d9ae7c8 |
children | 65ed2fcb9032 |
line wrap: on
line diff
--- a/hgext/patchbomb.py Tue Jun 26 02:04:17 2018 +0530 +++ b/hgext/patchbomb.py Tue Jun 26 02:05:11 2018 +0530 @@ -75,6 +75,7 @@ import email as emailmod import email.generator as emailgen +import email.mime.base as emimebase import email.mime.multipart as emimemultipart import email.utils as eutil import errno @@ -369,7 +370,7 @@ msg = emimemultipart.MIMEMultipart() if body: msg.attach(mail.mimeencode(ui, body, _charsets, opts.get(r'test'))) - datapart = emailmod.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') + datapart = emimebase.MIMEBase('application', 'x-mercurial-bundle') datapart.set_payload(bundle) bundlename = '%s.hg' % opts.get(r'bundlename', 'bundle') datapart.add_header('Content-Disposition', 'attachment',