mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 15:14:31 -04:00
dont get bin path when bin is missing
This commit is contained in:
parent
1b96c582a7
commit
3c7966c13a
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ import getpass
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
from pathlib import Path
|
||||||
from typing import Optional, Type, Tuple, Dict
|
from typing import Optional, Type, Tuple, Dict
|
||||||
from subprocess import run, PIPE, DEVNULL
|
from subprocess import run, PIPE, DEVNULL
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
@ -495,7 +496,7 @@ def bin_hash(binary: Optional[str]) -> Optional[str]:
|
||||||
if binary is None:
|
if binary is None:
|
||||||
return None
|
return None
|
||||||
abs_path = bin_path(binary)
|
abs_path = bin_path(binary)
|
||||||
if abs_path is None:
|
if abs_path is None or not Path(abs_path).exists():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
file_hash = md5()
|
file_hash = md5()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue