mail: force SMTPException to bytes before wrapping in error.Abort
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 19 Apr 2021 20:38:52 -0400
changeset 46992 5fa019ceb499
parent 46991 83c0d144ef8d
child 46993 f67b8946bb1b
child 47012 d55b71393907
mail: force SMTPException to bytes before wrapping in error.Abort Pytype wasn't complaining about this for some reason, but PyCharm was and we already handle another instance of this exception the same way in this function. Differential Revision: https://phab.mercurial-scm.org/D10473
mercurial/mail.py
--- a/mercurial/mail.py	Mon Apr 19 17:26:57 2021 -0400
+++ b/mercurial/mail.py	Mon Apr 19 20:38:52 2021 -0400
@@ -164,7 +164,7 @@
             recipients = [r[1] for r in inst.recipients.values()]
             raise error.Abort(b'\n' + b'\n'.join(recipients))
         except smtplib.SMTPException as inst:
-            raise error.Abort(inst)
+            raise error.Abort(stringutil.forcebytestr(inst))
 
     return send