From 6c65d283ec2a97f1ce60db0bc2d1b6a90782ac57 Mon Sep 17 00:00:00 2001 From: Joel Klein Date: Wed, 8 Nov 2023 22:22:46 +0100 Subject: [PATCH] better detection of windows --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index bc05162..bc0473c 100644 --- a/app.py +++ b/app.py @@ -25,6 +25,7 @@ if importlib.util.find_spec("win32com"): from win32com.client import * + WINDOWS = True def get_version_number(file_path): information_parser = Dispatch("Scripting.FileSystemObject") print(information_parser) @@ -32,6 +33,7 @@ def get_version_number(file_path): return version VERSION = f'v{get_version_number(sys.argv[0])}' else: + WINDOWS = False VERSION = 'DEV VERSION' @@ -300,7 +302,7 @@ def creation_date(self, path_to_file): last modified if that isn't possible. See http://stackoverflow.com/a/39501288/1709587 for explanation. ''' - if platform.system() == 'Windows': + if platform.system() == 'Windows' or WINDOWS: return os.path.getctime(path_to_file) else: stat = os.stat(path_to_file)