Skip to content

Commit

Permalink
gui - cleanup version check
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Oct 15, 2023
1 parent 05d8119 commit 89501ba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

dict_names = ("hashes", "mimes", "shaders")

# 3.10 has and issue with large dict files, regression fixed in 3.11
# 3.10 has an issue with large dict files, regression fixed in 3.11
ver = sys.version_info
if ver.major == 3 and ver.minor == 10:
raise Exception('Python 3.10 is not supported, please upgrade to 3.11 at least.')
Expand Down
5 changes: 5 additions & 0 deletions gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

def check_python() -> None:
"""Require Python == 3.11"""
is_64bits = sys.maxsize > 2 ** 32
if not is_64bits:
logging.warning(
"Either your operating system or your python installation is not 64 bits. "
"Large OVLs will crash unexpectedly!")
if (sys.version_info.major, sys.version_info.minor) != (3, 11):
logging.critical("Python 3.11 is required. Please change your Python installation.")
time.sleep(60)
Expand Down
11 changes: 0 additions & 11 deletions ovl_tool_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def __init__(self, opts: GuiOptions):
self.status_bar.insertPermanentWidget(2, self.finfo_sep)
self.status_bar.insertPermanentWidget(3, self.file_info)

self.check_version()
# run once here to make sure we catch the default game
self.populate_game()

Expand Down Expand Up @@ -588,16 +587,6 @@ def check_length(self, name_tups):
f"Continue renaming anyway?", title="Length Warning"):
return True

def check_version(self):
is_64bits = sys.maxsize > 2 ** 32
if not is_64bits:
self.showerror(
"Either your operating system or your python installation is not 64 bits.\n"
"Large OVLs will crash unexpectedly!")
if sys.version_info[0] != 3 or sys.version_info[1] < 7 or (
sys.version_info[1] == 7 and sys.version_info[2] < 6):
self.showerror("Python 3.7.6+ x64 bit is expected!")


if __name__ == '__main__':
startup(MainWindow, GuiOptions(log_name="ovl_tool_gui"))
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b55c0d449 - Sun Oct 15 15:54:45 2023 +0200
05d8119dc - Sun Oct 15 16:15:28 2023 +0200

0 comments on commit 89501ba

Please sign in to comment.