mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-06-06 09:31:19 -04:00
fix version string parsing on macOS in some cases where LANG C is not supported
This commit is contained in:
parent
4b8b17e788
commit
d05510f844
1 changed files with 2 additions and 0 deletions
|
@ -653,6 +653,8 @@ def bin_version(binary: Optional[str]) -> Optional[str]:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
version_str = run([abspath, "--version"], stdout=PIPE, env={'LANG': 'C'}).stdout.strip().decode()
|
version_str = run([abspath, "--version"], stdout=PIPE, env={'LANG': 'C'}).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
|
# take first 3 columns of first line of version info
|
||||||
return ' '.join(version_str.split('\n')[0].strip().split()[:3])
|
return ' '.join(version_str.split('\n')[0].strip().split()[:3])
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue