summaryrefslogtreecommitdiffstats
path: root/Tools/c-analyzer
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/c-analyzer')
-rw-r--r--Tools/c-analyzer/c_parser/preprocessor/common.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Tools/c-analyzer/c_parser/preprocessor/common.py b/Tools/c-analyzer/c_parser/preprocessor/common.py
index dbe1ede..06f8f4d 100644
--- a/Tools/c-analyzer/c_parser/preprocessor/common.py
+++ b/Tools/c-analyzer/c_parser/preprocessor/common.py
@@ -1,6 +1,7 @@
import contextlib
import distutils.ccompiler
import logging
+import os
import shlex
import subprocess
import sys
@@ -40,7 +41,12 @@ def run_cmd(argv, *,
kw.pop('kwargs')
kwargs.update(kw)
- proc = subprocess.run(argv, **kwargs)
+ # Remove LANG environment variable: the C parser doesn't support GCC
+ # localized messages
+ env = dict(os.environ)
+ env.pop('LANG', None)
+
+ proc = subprocess.run(argv, env=env, **kwargs)
return proc.stdout