changeset 46992:5fa019ceb499

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
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 19 Apr 2021 20:38:52 -0400
parents 83c0d144ef8d
children f67b8946bb1b d55b71393907
files mercurial/mail.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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