Skip to content

Commit

Permalink
bug 1316288 - Fix werror.py and check_cc_clang.py for cases where cc …
Browse files Browse the repository at this point in the history
…doesn't exist. r=franziskus

--HG--
extra : rebase_source : c2e6020bcbcc97604c52c841dec24702663a04e0
  • Loading branch information
luser committed Nov 8, 2016
1 parent afc885c commit cebbcd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion coreconf/check_cc_clang.py
Expand Up @@ -9,7 +9,11 @@ def main():
print 0
else:
cc = os.environ.get('CC', 'cc')
cc_is_clang = 'clang' in subprocess.check_output([cc, '--version'])
try:
cc_is_clang = 'clang' in subprocess.check_output([cc, '--version'])
except OSError:
# We probably just don't have CC/cc.
cc_is_clang = False
print int(cc_is_clang)

if __name__ == '__main__':
Expand Down
6 changes: 5 additions & 1 deletion coreconf/werror.py
Expand Up @@ -6,7 +6,11 @@
def main():
cc = os.environ.get('CC', 'cc')
sink = open(os.devnull, 'wb')
cc_is_clang = 'clang' in subprocess.check_output([cc, '--version'], stderr=sink)
try:
cc_is_clang = 'clang' in subprocess.check_output([cc, '--version'], stderr=sink)
except OSError:
# We probably just don't have CC/cc.
return

def warning_supported(warning):
return subprocess.call([cc, '-x', 'c', '-E', '-Werror',
Expand Down

0 comments on commit cebbcd2

Please sign in to comment.