From 18c98483acc6adb13b22dfd6d356dac5128cd8e5 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 1 Apr 2020 18:49:45 +0200 Subject: [PATCH] wizard: (trivial) add some type hints --- electrum/base_wizard.py | 2 +- electrum/gui/qt/installwizard.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/electrum/base_wizard.py b/electrum/base_wizard.py index 80df02316..a80638483 100644 --- a/electrum/base_wizard.py +++ b/electrum/base_wizard.py @@ -144,7 +144,7 @@ class BaseWizard(Logger): self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type) def upgrade_db(self, storage, db): - exc = None + exc = None # type: Optional[Exception] def on_finished(): if exc is None: self.terminate(storage=storage, db=db) diff --git a/electrum/gui/qt/installwizard.py b/electrum/gui/qt/installwizard.py index 961f88916..3d139a0cc 100644 --- a/electrum/gui/qt/installwizard.py +++ b/electrum/gui/qt/installwizard.py @@ -31,6 +31,7 @@ from electrum.plugin import run_hook, Plugins if TYPE_CHECKING: from electrum.simple_config import SimpleConfig + from electrum.wallet_db import WalletDB from . import ElectrumGui @@ -321,7 +322,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): return temp_storage.path, (temp_storage if temp_storage.file_exists() else None) - def run_upgrades(self, storage, db): + def run_upgrades(self, storage: WalletStorage, db: 'WalletDB') -> None: path = storage.path if db.requires_split(): self.hide() @@ -360,8 +361,6 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): if db.requires_upgrade(): self.upgrade_db(storage, db) - return db - def on_error(self, exc_info): if not isinstance(exc_info[1], UserCancelled): self.logger.error("on_error", exc_info=exc_info)