fix raise UserCacnelled calls (#6304)
This commit is contained in:
@@ -299,7 +299,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
|||||||
def run_user_interaction_loop():
|
def run_user_interaction_loop():
|
||||||
while True:
|
while True:
|
||||||
if self.loop.exec_() != 2: # 2 = next
|
if self.loop.exec_() != 2: # 2 = next
|
||||||
raise UserCancelled
|
raise UserCancelled()
|
||||||
assert temp_storage
|
assert temp_storage
|
||||||
if temp_storage.file_exists() and not temp_storage.is_encrypted():
|
if temp_storage.file_exists() and not temp_storage.is_encrypted():
|
||||||
break
|
break
|
||||||
@@ -423,7 +423,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
|||||||
self.set_layout(layout, title, next_enabled)
|
self.set_layout(layout, title, next_enabled)
|
||||||
result = self.loop.exec_()
|
result = self.loop.exec_()
|
||||||
if not result and raise_on_cancel:
|
if not result and raise_on_cancel:
|
||||||
raise UserCancelled
|
raise UserCancelled()
|
||||||
if result == 1:
|
if result == 1:
|
||||||
raise GoBack from None
|
raise GoBack from None
|
||||||
self.title.setVisible(False)
|
self.title.setVisible(False)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class TrezorClientBase(HardwareClientBase, Logger):
|
|||||||
self.end_flow()
|
self.end_flow()
|
||||||
if e is not None:
|
if e is not None:
|
||||||
if isinstance(e, Cancelled):
|
if isinstance(e, Cancelled):
|
||||||
raise UserCancelled from e
|
raise UserCancelled() from e
|
||||||
elif isinstance(e, TrezorFailure):
|
elif isinstance(e, TrezorFailure):
|
||||||
raise RuntimeError(str(e)) from e
|
raise RuntimeError(str(e)) from e
|
||||||
elif isinstance(e, OutdatedFirmwareError):
|
elif isinstance(e, OutdatedFirmwareError):
|
||||||
|
|||||||
Reference in New Issue
Block a user