Fix some problems found if no MS compiler at all#3231
Conversation
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>
| return None | ||
| result = env.WhereIs(prog) | ||
| if norm and os.sep != '/': | ||
| if result and norm and os.sep != '/': |
There was a problem hiding this comment.
Can you add to the docstring for detect what the arguments do?
There was a problem hiding this comment.
Looks like Norm should default to False and is a boolean flag to say whether to normalize the path?
There was a problem hiding this comment.
didn't look at norm... will do so. just added the check that if env.WhereIs didn't have a good result, then doing replace on it throws error
AttributeError: 'NoneType' object has no attribute 'replace'
I'll update docstring.
| return self._stdout[run] | ||
| try: | ||
| return self._stdout[run] | ||
| except IndexError: |
There was a problem hiding this comment.
When would this happen? Can you add a comment?
There was a problem hiding this comment.
Had an exception... I guess there's no contents to self._stdout at all, so can't index into it.
493/1179 (41.82%) C:\\Python37\\python.exe -tt test\Interactive\implicit-VariantDir.py
timed out waiting for C:\Users\mats\AppData\Local\Temp\testcmd.6464.8hocmiyx\1 to exist
Traceback (most recent call last):
File "test\Interactive\implicit-VariantDir.py", line 106, in <module>
test.wait_for(test.workpath('1'))
File "C:\users\mats\Documents\github\scons\testing\framework\TestSCons.py", line 1375, in wait_for
stdout = self.stdout()
File "C:\users\mats\Documents\github\scons\testing\framework\TestCmd.py", line 1593, in stdout
return self._stdout[run]
IndexError: list index out of range
There was a problem hiding this comment.
does your change skip the exception but fail the test if it should fail?
There was a problem hiding this comment.
hmmm.... doesn't look like there's a case for what happens. not sure what should happen.
There was a problem hiding this comment.
now that it's merged... implicit-VariantDir passes, which maybe it shouldn't? The two from the other test, sconsign/script/Configure.py and dblite.py (same dir) both pass now.
Signed-off-by: Mats Wichmann <mats@linux.com>
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. Changes are to the test harness.
Signed-off-by: Mats Wichmann mats@linux.com
Contributor Checklist:
master/src/CHANGES.txtdirectory (and read theREADME.txtin that directory)