summaryrefslogtreecommitdiffstats
path: root/rtemstoolkit/mailer.py
diff options
context:
space:
mode:
Diffstat (limited to 'rtemstoolkit/mailer.py')
-rw-r--r--rtemstoolkit/mailer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/rtemstoolkit/mailer.py b/rtemstoolkit/mailer.py
index df42580..e24ed12 100644
--- a/rtemstoolkit/mailer.py
+++ b/rtemstoolkit/mailer.py
@@ -75,7 +75,7 @@ class mail:
mrc = open(mailrc, 'r')
lines = mrc.readlines()
mrc.close()
- except IOError, err:
+ except IOError as err:
raise error.general('error reading: %s' % (mailrc))
for l in lines:
l = _clean(l)
@@ -104,9 +104,9 @@ class mail:
try:
s = smtplib.SMTP(self.smtp_host())
s.sendmail(from_addr, [to_addr], msg)
- except smtplib.SMTPException, se:
+ except smtplib.SMTPException as se:
raise error.general('sending mail: %s' % (str(se)))
- except socket.error, se:
+ except socket.error as se:
raise error.general('sending mail: %s' % (str(se)))
if __name__ == '__main__':
@@ -115,6 +115,6 @@ if __name__ == '__main__':
append_options(optargs)
opts = options.load(sys.argv, optargs = optargs, defaults = 'defaults.mc')
m = mail(opts)
- print 'From: %s' % (m.from_address())
- print 'SMTP Host: %s' % (m.smtp_host())
+ print('From: %s' % (m.from_address()))
+ print('SMTP Host: %s' % (m.smtp_host()))
m.send(m.from_address(), 'Test mailer.py', 'This is a test')