Guard against nonexisting linker.

pull/15/head
Jussi Pakkanen 12 years ago
parent 06a69a6b1c
commit 8e68f30e8f
  1. 7
      environment.py

@ -349,10 +349,13 @@ class Environment():
if out.startswith('clang'): if out.startswith('clang'):
return ClangCXXCompiler(exelist) return ClangCXXCompiler(exelist)
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')
def detect_static_linker(self): def detect_static_linker(self):
exelist = self.get_static_linker_exelist() exelist = self.get_static_linker_exelist()
p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) try:
p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except OSError:
raise EnvironmentException('Could not execute static linker "%s".' % ' '.join(exelist))
(out, err) = p.communicate() (out, err) = p.communicate()
out = out.decode() out = out.decode()
err = err.decode() err = err.decode()

Loading…
Cancel
Save