diff options
author | Mats Wichmann <mats@linux.com> | 2018-10-30 19:37:20 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2018-10-30 19:37:20 (GMT) |
commit | d5e8a048c87eac0361f14911a2d224bfb94884f0 (patch) | |
tree | 1edf909acb41ffa73a938dbc4b03803c9292f9aa /testing | |
parent | b70ca92f9d0557246854a617edc214e51f62c937 (diff) | |
download | SCons-d5e8a048c87eac0361f14911a2d224bfb94884f0.zip SCons-d5e8a048c87eac0361f14911a2d224bfb94884f0.tar.gz SCons-d5e8a048c87eac0361f14911a2d224bfb94884f0.tar.bz2 |
Fix some problems found if no MS compiler at all
A few tests blew up with exceptions (AttributeError, IndexError) if no
compiler is installed on Windows - from where they are it could possibly
happen on other platforms as well.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestCmd.py | 5 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 96b8b5d..6699d88 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -1590,7 +1590,10 @@ class TestCmd(object): elif run < 0: run = len(self._stdout) + run run = run - 1 - return self._stdout[run] + try: + return self._stdout[run] + except IndexError: + return None def subdir(self, *subdirs): """Create new subdirectories under the temporary working diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 68641f0..69d4bd5 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -310,7 +310,7 @@ class TestSCons(TestCommon): if v != prog: return None result = env.WhereIs(prog) - if norm and os.sep != '/': + if result and norm and os.sep != '/': result = result.replace(os.sep, '/') return result |