This section of code is inside a try/except OSError block elsewhere, I think somewhere in theano.compile. The outer try/except block thinks that OSError means g++ is not installed. It responds by asserting that the linker is not the cvm. So these assertions are an improvement--it's going to die by an assert either way, and at least this assert relates to the actual problem. We should definitely not raise the original exception or any other OSError, unless we fix theano.compile to not interpret OSError incorrectly.