Remove second serve dependencies check

The second one isnt needed so long as the YAML import is 2nd. Once it tries to import serve it will fail and it's ImportError will get handled.
This commit is contained in:
rlaphoenix 2022-08-02 00:21:04 +01:00
parent 4bc0edcca9
commit 6a286a4c23

View File

@ -1,5 +1,4 @@
import logging
import sys
from datetime import datetime
from pathlib import Path
from typing import Optional
@ -299,16 +298,8 @@ def serve_(config: Path, host: str, port: int):
Host as 127.0.0.1 may block remote access even if port-forwarded.
Instead, use 0.0.0.0 and ensure the TCP port you choose is forwarded.
"""
try:
import yaml
from pywidevine import serve
except ImportError:
print(
"Missing the extra dependencies for serve functionality. "
"You may install them under poetry with `poetry install -E serve`, "
"or under pip with `pip install pywidevine[serve]`."
)
sys.exit(1)
import yaml
config = yaml.safe_load(config.read_text(encoding="utf8"))
serve.run(config, host, port)