From fa4352f3b626152ad362d9831a93fe243c651059 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Wed, 10 Jul 2024 14:00:15 +0100 Subject: [PATCH] Fix profile manager used before checked for None (#3272) * Fix: profile manager used before checked for None * ./check --- qt/aqt/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qt/aqt/__init__.py b/qt/aqt/__init__.py index 02b70af1f..42e02e1c2 100644 --- a/qt/aqt/__init__.py +++ b/qt/aqt/__init__.py @@ -671,11 +671,6 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp # we've signaled the primary instance, so we should close return None - setup_logging( - pm.addon_logs(), - level=logging.DEBUG if int(os.getenv("ANKIDEV", "0")) else logging.INFO, - ) - if not pm: if i18n_setup: QMessageBox.critical( @@ -687,6 +682,11 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp QMessageBox.critical(None, "Startup Failed", "Unable to create data folder") return None + setup_logging( + pm.addon_logs(), + level=logging.DEBUG if int(os.getenv("ANKIDEV", "0")) else logging.INFO, + ) + # disable icons on mac; this must be done before window created if is_mac: app.setAttribute(Qt.ApplicationAttribute.AA_DontShowIconsInMenus)