From 4d4d0e7216ab1c421cff827b1c8696aca292e4e2 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 11 Dec 2020 11:41:15 +0100 Subject: [PATCH] fix(python): do not call EndSession in bootloader mode (fixes #1379) --- python/src/trezorlib/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/src/trezorlib/client.py b/python/src/trezorlib/client.py index 249da1a86..fb888b404 100644 --- a/python/src/trezorlib/client.py +++ b/python/src/trezorlib/client.py @@ -398,10 +398,13 @@ class TrezorClient: The session will become invalid until `init_device()` is called again. If passphrase is enabled, further actions will prompt for it again. + + This is a no-op in bootloader mode, as it does not support session management. """ # since: 2.3.4, 1.9.4 try: - self.call(messages.EndSession()) + if not self.features.bootloader_mode: + self.call(messages.EndSession()) except exceptions.TrezorFailure: # A failure most likely means that the FW version does not support # the EndSession call. We ignore the failure and clear the local session_id.