-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: allow graceful recovery for no Liux compiler #7549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
os.chdir(self._dir1) | ||
c.compile([os.path.basename(self._src1)], output_dir=self._dir1) | ||
# Ensure that the object exists | ||
assert_(os.path.isfile(self._src1.replace('.c', '.o')) or | ||
os.path.isfile(self._src1.replace('.c', '.obj'))) | ||
os.chdir(previousDir) | ||
except OSError: | ||
except (OSError, CompileError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although - now I think about it - I am not sure what error this test is checking for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean - under what situations is this test meant to fail?
d868623
to
aba48d2
Compare
aba48d2
to
b85de38
Compare
If there is no compiler on Linux, the error we were getting was CompileError rather than the OSError the test was expecting. This had the nasty side-effect of leaving us in a deleted temporary directory, causing later test failures. Try a check to see if we have a compiler and skip otherwise.
b85de38
to
fc398de
Compare
I concur, skip test if no compiler present. With no compiler the functionality it tests would not be used. :) |
The updated diff looks good to me. @matthew-brett: is it ready for merge, or were you still working on something? |
No, I think that's as good as I can do - have tested on Linux and Windows with and without compiler. |
OK, in we go then. Thanks! |
@matthew-brett Your commit message lacks line breaks, you might want to configure your editor to take care of that. |
Sorry about that - working on Windows makes everything a little strange. |
If there is no compiler on Linux, the error we were getting was CompileError
rather than the OSError the test was expecting.
This had the nasty side-effect of leaving us in a deleted temporary directory,
causing later test failures.