mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Fix c-analyzer for GCC: ignore LANG env var (#106173)
The c-analyzer doesn't support GCC localized messages, so just unset the LANG environment variable.
This commit is contained in:
parent
adaacf26d3
commit
1f74b9e933
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue