diff --git a/python/src/trezorlib/cli/__init__.py b/python/src/trezorlib/cli/__init__.py index b2fc89255c..da2a126eba 100644 --- a/python/src/trezorlib/cli/__init__.py +++ b/python/src/trezorlib/cli/__init__.py @@ -146,7 +146,7 @@ class TrezorConnection: client = self.get_client() if must_resume and self.session_id is None: click.echo("Failed to resume session - no session id provided") - return None + raise RuntimeError("Failed to resume session - no session id provided") # Try resume session from id if self.session_id is not None: @@ -162,7 +162,7 @@ class TrezorConnection: if must_resume: if session.id != self.session_id or session.id is None: click.echo("Failed to resume session") - return None + RuntimeError("Failed to resume session - no session id provided") return session features = client.protocol.get_features() diff --git a/python/src/trezorlib/transport/thp/protocol_v1.py b/python/src/trezorlib/transport/thp/protocol_v1.py index ca5b3c8b30..baea7e7401 100644 --- a/python/src/trezorlib/transport/thp/protocol_v1.py +++ b/python/src/trezorlib/transport/thp/protocol_v1.py @@ -1,4 +1,5 @@ from __future__ import annotations + import logging import struct import typing as t