mirror of
https://github.com/devine-dl/pywidevine.git
synced 2024-10-30 13:39:18 +00:00
13 lines
296 B
Python
13 lines
296 B
Python
|
import shutil
|
||
|
from pathlib import Path
|
||
|
from typing import Optional
|
||
|
|
||
|
|
||
|
def get_binary_path(*names: str) -> Optional[Path]:
|
||
|
"""Get the path of the first found binary name."""
|
||
|
for name in names:
|
||
|
path = shutil.which(name)
|
||
|
if path:
|
||
|
return Path(path)
|
||
|
return None
|