mirror of
https://github.com/devine-dl/pywidevine.git
synced 2025-04-29 22:24:36 +02: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
|