diff options
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py index 700849e8..2fc894d0 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -47,12 +47,19 @@ except Exception, e: EXPECTED_LLVM_VERSION = (3,1) +def check_clang_version(): + expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION)) + actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0] + if expected in actual: + return True + + print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected) + return False + + def check_llvm_version(): try: - expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION)) - actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0][0:len(expected)] - if expected != actual: - print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected) + check_clang_version(); except Exception, e: print >> sys.stderr, 'warning: Could not verify LLVM version: %s' % str(e) |