Fix version display

This commit is contained in:
Piero Toffanin 2026-02-27 02:50:39 -05:00
parent 061a34b813
commit c7bf3ff9b3

View File

@ -54,10 +54,18 @@ emojis = {e: True for e in \
def get_version():
try:
with open("VERSION") as f:
with open(os.path.join(os.path.dirname(__file__), "..", "VERSION")) as f:
return f.read().strip()
except:
return "?"
except OSError:
pass
try:
from importlib.metadata import version
return version("libretranslate")
except Exception:
pass
return "?"
def get_upload_dir():