mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-21 05:41:54 +02:00
fix version string parsing on macOS in some cases where LANG C is not supported
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user