# HG changeset patch # User Denis Laxalde # Date 1570708110 -7200 # Node ID 7d912413a3ae22931021deac20ac672a574ecac8 # Parent a2ff3aff81d244685cf2f25a1ee92f379d1d115c py3: use as_bytes() method of EmailMessage In Python 3, as_bytes() corresponds to as_string() in Python 2. diff -r a2ff3aff81d2 -r 7d912413a3ae hgext/notify.py --- a/hgext/notify.py Wed Oct 23 23:00:58 2019 +0100 +++ b/hgext/notify.py Thu Oct 10 13:48:30 2019 +0200 @@ -440,7 +440,7 @@ msg[r'Message-Id'] = messageid(ctx, self.domain, self.messageidseed) msg[r'To'] = encoding.strfromlocal(b', '.join(sorted(subs))) - msgtext = encoding.strtolocal(msg.as_string()) + msgtext = msg.as_bytes() if pycompat.ispy3 else msg.as_string() if self.test: self.ui.write(msgtext) if not msgtext.endswith(b'\n'):