# HG changeset patch # User Victor NOEL # Date 2010-10-25 21:13:31 # Node ID 921d3d72062df63c373710632766ccd5326d3b8e # Parent 68b2255c7e11c29e0a86cf1323c9af157884942c python 3 compatible diff --git a/mercurial_keyring.py b/mercurial_keyring.py --- a/mercurial_keyring.py +++ b/mercurial_keyring.py @@ -299,7 +299,7 @@ def try_smtp_login(ui, smtp_obj, usernam (username)) smtp_obj.login(username, password) return True - except smtplib.SMTPException, inst: + except smtplib.SMTPException as inst: if inst.smtp_code == 535: ui.status(_("SMTP login failed: %s\n\n") % inst.smtp_error) return False @@ -350,10 +350,10 @@ def keyring_supported_smtp(ui, username) def send(sender, recipients, msg): try: return s.sendmail(sender, recipients, msg) - except smtplib.SMTPRecipientsRefused, inst: + except smtplib.SMTPRecipientsRefused as inst: recipients = [r[1] for r in inst.recipients.values()] raise util.Abort('\n' + '\n'.join(recipients)) - except smtplib.SMTPException, inst: + except smtplib.SMTPException as inst: raise util.Abort(inst) return send