mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00: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:
|
||||
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
|
||||
return ' '.join(version_str.split('\n')[0].strip().split()[:3])
|
||||
except OSError:
|
||||
|
|
Loading…
Reference in a new issue