py3: use as_bytes() method of EmailMessage
In Python 3, as_bytes() corresponds to as_string() in Python 2.
--- 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'):