From 923b1c42b0f4dcb8a5af72b253446b2da18a2819 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Thu, 23 Mar 2023 18:04:28 +0100 Subject: [PATCH] fix(cli): don't try to initialize device after wipe in bootloader --- python/.changelog.d/2904.fixed | 1 + python/src/trezorlib/device.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 python/.changelog.d/2904.fixed diff --git a/python/.changelog.d/2904.fixed b/python/.changelog.d/2904.fixed new file mode 100644 index 000000000..67b7f4be5 --- /dev/null +++ b/python/.changelog.d/2904.fixed @@ -0,0 +1 @@ +Removed attempt to initialize the device after wipe in bootloader mode diff --git a/python/src/trezorlib/device.py b/python/src/trezorlib/device.py index 79c75eff8..bad8d5b75 100644 --- a/python/src/trezorlib/device.py +++ b/python/src/trezorlib/device.py @@ -101,7 +101,8 @@ def sd_protect( @session def wipe(client: "TrezorClient") -> "MessageType": ret = client.call(messages.WipeDevice()) - client.init_device() + if not client.features.bootloader_mode: + client.init_device() return ret