Files
anime_dub_sync/utils.py
T
2026-03-20 00:46:36 +01:00

25 lines
615 B
Python

import subprocess
from typing import Optional, List
def run(cmd: subprocess._CMD) -> subprocess.CompletedProcess[str]:
"""
Run a subprocess command.
Args:
cmd: Command and arguments as a list.
Raises:
subprocess.CalledProcessError: If the command exits with a non-zero status.
"""
try:
result = subprocess.run(
cmd,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True
)
return result
except subprocess.CalledProcessError as e:
print(e.stdout)
raise