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:
parent
4bc0edcca9
commit
6a286a4c23
|
@ -1,5 +1,4 @@
|
||||||
import logging
|
import logging
|
||||||
import sys
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
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.
|
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.
|
Instead, use 0.0.0.0 and ensure the TCP port you choose is forwarded.
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
import yaml
|
|
||||||
from pywidevine import serve
|
from pywidevine import serve
|
||||||
except ImportError:
|
import yaml
|
||||||
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)
|
|
||||||
|
|
||||||
config = yaml.safe_load(config.read_text(encoding="utf8"))
|
config = yaml.safe_load(config.read_text(encoding="utf8"))
|
||||||
serve.run(config, host, port)
|
serve.run(config, host, port)
|
||||||
|
|
Loading…
Reference in New Issue