mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
[3.12] Fix c-analyzer for GCC: ignore LANG env var (GH-106173) (#106178)
Fix c-analyzer for GCC: ignore LANG env var (GH-106173)
The c-analyzer doesn't support GCC localized messages, so just unset
the LANG environment variable.
(cherry picked from commit 1f74b9e933
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
c1c6738526
commit
0373c2ccd5
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