General Backend Fixes (#373)

* General Backend Fixes

* Ajust helpers.get_loader_version() to never throw an exception
This commit is contained in:
suchmememanyskill
2023-02-20 01:37:26 +01:00
committed by GitHub
parent b94cfe32d9
commit e1807e8c75
3 changed files with 13 additions and 24 deletions
+3 -3
View File
@@ -116,10 +116,10 @@ def mkdir_as_user(path):
# Fetches the version of loader
def get_loader_version() -> str:
try:
with open(os.path.join(os.path.dirname(sys.argv[0]), ".loader.version"), "r", encoding="utf-8") as version_file:
return version_file.readline().replace("\n", "")
with open(os.path.join(os.getcwd(), ".loader.version"), "r", encoding="utf-8") as version_file:
return version_file.readline().strip()
except:
return ""
return "unknown"
# returns the appropriate system python paths
def get_system_pythonpaths() -> list[str]: