summaryrefslogtreecommitdiffstats
path: root/rtemstoolkit/mailer.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-03-03 16:46:18 +1100
committerChris Johns <chrisj@rtems.org>2016-03-03 16:53:39 +1100
commitb0fa2ae9981b0ccf6a66cb8df2241caa5038eb36 (patch)
treed4f7f225cd35334ff18c3189bf1cdefa0d3335b4 /rtemstoolkit/mailer.py
parentAdd aarch64 and x86_64 binutils and gdb patches. (diff)
downloadrtems-tools-b0fa2ae9981b0ccf6a66cb8df2241caa5038eb36.tar.bz2
Update rtems-tool to support Python 2 and 3.
Add solaris and netbsd. Close #2619.
Diffstat (limited to 'rtemstoolkit/mailer.py')
-rw-r--r--rtemstoolkit/mailer.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/rtemstoolkit/mailer.py b/rtemstoolkit/mailer.py
index e24ed12..7f71d10 100644
--- a/rtemstoolkit/mailer.py
+++ b/rtemstoolkit/mailer.py
@@ -1,6 +1,6 @@
#
# RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2013-2014 Chris Johns (chrisj@rtems.org)
+# Copyright 2013-2016 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -32,13 +32,24 @@
# Manage emailing results or reports.
#
+from __future__ import print_function
+
import os
import smtplib
import socket
-import error
-import options
-import path
+#
+# Support to handle use in a package and as a unit test.
+# If there is a better way to let us know.
+#
+try:
+ from . import error
+ from . import options
+ from . import path
+except (ValueError, SystemError):
+ import error
+ import options
+ import path
def append_options(opts):
opts['--mail'] = 'Send email report or results.'