From b0fa2ae9981b0ccf6a66cb8df2241caa5038eb36 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Thu, 3 Mar 2016 16:46:18 +1100 Subject: Update rtems-tool to support Python 2 and 3. Add solaris and netbsd. Close #2619. --- rtemstoolkit/mailer.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'rtemstoolkit/mailer.py') 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.' -- cgit v1.2.3