1
0
Fork 0
mirror of synced 2024-06-27 18:40:52 +12:00

Merge pull request #1197 from overhacked/bin_version_env_fix

This commit is contained in:
Nick Sweeting 2023-08-01 10:12:59 -07:00 committed by GitHub
commit 5b7ecfc872
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -690,7 +690,8 @@ def bin_version(binary: Optional[str]) -> Optional[str]:
return None
try:
version_str = run([abspath, "--version"], stdout=PIPE, env={'LANG': 'C'}).stdout.strip().decode()
bin_env = os.environ | {'LANG': 'C'}
version_str = run([abspath, "--version"], stdout=PIPE, env=bin_env).stdout.strip().decode()
if not version_str:
version_str = run([abspath, "--version"], stdout=PIPE).stdout.strip().decode()
# take first 3 columns of first line of version info