Fix potential python deps not being imported in web UI

This commit is contained in:
Théophile Diot 2024-01-04 13:37:20 +00:00
parent 413500e5d3
commit 3e63f2ad0c
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -8,13 +8,7 @@ from string import ascii_letters, digits
from sys import path as sys_path, modules as sys_modules
from pathlib import Path
os_release_path = Path(sep, "etc", "os-release")
if os_release_path.is_file() and "Alpine" not in os_release_path.read_text(encoding="utf-8"):
sys_path.append(join(sep, "usr", "share", "bunkerweb", "deps", "python"))
del os_release_path
for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in (("utils",), ("api",), ("db",))]:
for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in (("deps", "python"), ("utils",), ("api",), ("db",))]:
if deps_path not in sys_path:
sys_path.append(deps_path)