Browse Source

qt gui __init__: restore import order - raise pyqt5 missing early

follow-up https://github.com/spesmilo/electrum/pull/8560
master
SomberNight 2 years ago
parent
commit
4978d40956
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 14
      electrum/gui/qt/__init__.py

14
electrum/gui/qt/__init__.py

@ -29,18 +29,13 @@ import sys
import threading
from typing import Optional, TYPE_CHECKING, List, Sequence
from electrum import GuiImportError, WalletStorage
from .wizard.server_connect import QEServerConnectWizard
from .wizard.wallet import QENewWalletWizard
from electrum.wizard import WizardViewState
from electrum.keystore import load_keystore
try:
import PyQt5
import PyQt5.QtGui
except Exception as e:
from electrum import GuiImportError
raise GuiImportError(
"Error: Could not import PyQt5 on Linux systems, "
"Error: Could not import PyQt5. On Linux systems, "
"you may try 'sudo apt-get install python3-pyqt5'") from e
from PyQt5.QtGui import QGuiApplication
@ -65,6 +60,9 @@ from electrum.wallet_db import WalletDB, WalletRequiresSplit, WalletRequiresUpgr
from electrum.logging import Logger
from electrum.gui import BaseElectrumGui
from electrum.simple_config import SimpleConfig
from electrum.storage import WalletStorage
from electrum.wizard import WizardViewState
from electrum.keystore import load_keystore
from .util import read_QIcon, ColorScheme, custom_message_box, MessageBoxMixin, WWLabel
from .main_window import ElectrumWindow
@ -73,6 +71,8 @@ from .stylesheet_patcher import patch_qt_stylesheet
from .lightning_dialog import LightningDialog
from .watchtower_dialog import WatchtowerDialog
from .exception_window import Exception_Hook
from .wizard.server_connect import QEServerConnectWizard
from .wizard.wallet import QENewWalletWizard
if TYPE_CHECKING:
from electrum.daemon import Daemon

Loading…
Cancel
Save