Skip to content

Commit

Permalink
bump patcher v1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Feb 24, 2024
1 parent 9cf503b commit e5bd30e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Tools/HoloPatcher/src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@
)
from typing import TYPE_CHECKING, NoReturn

if getattr(sys, "frozen", False) is False:

def is_frozen() -> bool: # sourcery skip: assign-if-exp, boolean-if-exp-identity, reintroduce-else, remove-unnecessary-cast
# Check for sys.frozen attribute
if getattr(sys, "frozen", False):
return True
# Check if the executable is in a temp directory (common for frozen apps)
if tempfile.gettempdir() in sys.executable:
return True
return False


if not is_frozen():
def update_sys_path(path):
working_dir = str(path)
if working_dir not in sys.path:
Expand All @@ -43,7 +54,6 @@ def update_sys_path(path):
if utility_path.exists():
update_sys_path(utility_path.parent)


from pykotor.common.misc import Game
from pykotor.common.stream import BinaryReader
from pykotor.extract.file import ResourceIdentifier
Expand All @@ -67,7 +77,7 @@ def update_sys_path(path):
from pykotor.tslpatcher.logger import PatchLog
from pykotor.tslpatcher.namespaces import PatcherNamespace

CURRENT_VERSION: tuple[int, ...] = (1, 5, 2)
CURRENT_VERSION: tuple[int, ...] = (1, 5, 3)
VERSION_LABEL = f"v{'.'.join(map(str, CURRENT_VERSION))}"


Expand Down Expand Up @@ -1341,16 +1351,6 @@ def onAppCrash(
sys.excepthook = onAppCrash


def is_frozen() -> bool: # sourcery skip: assign-if-exp, boolean-if-exp-identity, reintroduce-else, remove-unnecessary-cast
# Check for sys.frozen attribute
if getattr(sys, "frozen", False):
return True
# Check if the executable is in a temp directory (common for frozen apps)
if tempfile.gettempdir() in sys.executable:
return True
return False


def main():
app = App()
app.mainloop()
Expand Down

0 comments on commit e5bd30e

Please sign in to comment.