comparison roundup/mailer.py @ 5379:17edccfe1755

Python 3 preparation: "except" syntax. Changing "except Exception, var" to "except Exception as var". Tool-generated patch.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 21:42:22 +0000
parents 198b6e810c67
children 56c9bcdea47f
comparison
equal deleted inserted replaced
5378:35ea9b1efc14 5379:17edccfe1755
293 smtp = SMTPConnection(self.config) 293 smtp = SMTPConnection(self.config)
294 smtp.sendmail(sender, to, message) 294 smtp.sendmail(sender, to, message)
295 except socket.error as value: 295 except socket.error as value:
296 raise MessageSendError("Error: couldn't send email: " 296 raise MessageSendError("Error: couldn't send email: "
297 "mailhost %s"%value) 297 "mailhost %s"%value)
298 except smtplib.SMTPException, msg: 298 except smtplib.SMTPException as msg:
299 raise MessageSendError("Error: couldn't send email: %s"%msg) 299 raise MessageSendError("Error: couldn't send email: %s"%msg)
300 300
301 class SMTPConnection(smtplib.SMTP): 301 class SMTPConnection(smtplib.SMTP):
302 ''' Open an SMTP connection to the mailhost specified in the config 302 ''' Open an SMTP connection to the mailhost specified in the config
303 ''' 303 '''

Roundup Issue Tracker: http://roundup-tracker.org/