From 96c5c4aa28cf38afa51ecc3eb2f0a9c65d91b686 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sat, 7 Oct 2023 11:49:08 -0700 Subject: [PATCH] Fix pyinstaller build Fix exception when PyQt is not installed --- comictaggerlib/gui.py | 3 ++- comictaggerlib/main.py | 2 ++ setup.cfg | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/comictaggerlib/gui.py b/comictaggerlib/gui.py index f297646..f4e0422 100644 --- a/comictaggerlib/gui.py +++ b/comictaggerlib/gui.py @@ -82,13 +82,14 @@ try: return True return super().event(event) -except ImportError: +except ImportError as e: def show_exception_box(log_msg: str) -> None: ... logger.exception("Qt unavailable") qt_available = False + import_error = e def open_tagger_window( diff --git a/comictaggerlib/main.py b/comictaggerlib/main.py index b351420..c648bb7 100644 --- a/comictaggerlib/main.py +++ b/comictaggerlib/main.py @@ -217,6 +217,8 @@ class App: try: from comictaggerlib import gui + if not gui.qt_available: + raise gui.import_error return gui.open_tagger_window(talkers, self.config, error) except ImportError: self.config[0].Runtime_Options_no_gui = True diff --git a/setup.cfg b/setup.cfg index cb0b85c..371ea37 100644 --- a/setup.cfg +++ b/setup.cfg @@ -221,7 +221,7 @@ depends = clean pypi-upload deps = - pyinstaller>=5.6.2 + pyinstaller>=5.6.2,!=6.0.0 extras = all commands = @@ -281,7 +281,7 @@ deps = types-setuptools types-requests build - pyinstaller>=5.6.2 + pyinstaller>=5.6.2,!=6.0.0 [flake8] max-line-length = 120