Skip to content

Commit 74f6f11

Browse files
committed
fix(python): fix trezorctl firmware update device restarts' handling
1 parent 8a0cf0e commit 74f6f11

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

python/.changelog.d/5000.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed device restart handling during firmware update.

python/src/trezorlib/transport/webusb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def close(self) -> None:
7575
self.handle.releaseInterface(self.interface)
7676
self.handle.close()
7777
except Exception as e:
78-
raise TransportException(f"USB close failed: {e}") from e
78+
# the device may restart before/during `USBDeviceHandle.close()` is called.
79+
LOG.warning("Failed to close %s: %s", self.handle, e)
7980
self.handle = None
8081

8182
def write_chunk(self, chunk: bytes) -> None:

0 commit comments

Comments
 (0)