# HG changeset patch # User Gregory Szorc # Date 1518387910 28800 # Node ID 1407c42b302cfb9dc65fbf3367d580bc291b207c # Parent a5cf79755eff37cb70d24a24a35a18c8866fb385 py3: pass system string to email.message.Message.set_type() Python 3 insists the type is a str. Differential Revision: https://phab.mercurial-scm.org/D2149 diff -r a5cf79755eff -r 1407c42b302c mercurial/mail.py --- a/mercurial/mail.py Sun Feb 11 14:18:27 2018 -0800 +++ b/mercurial/mail.py Sun Feb 11 14:25:10 2018 -0800 @@ -20,6 +20,7 @@ from . import ( encoding, error, + pycompat, sslutil, util, ) @@ -218,7 +219,7 @@ ''' cs = email.charset.Charset(charset) msg = email.message.Message() - msg.set_type('text/' + subtype) + msg.set_type(pycompat.sysstr('text/' + subtype)) for line in body.splitlines(): if len(line) > 950: