From 28eaa8552d6a3bd86af2a2ac846ed12f8ec19fc0 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Tue, 11 Mar 2025 11:25:37 +0100 Subject: [PATCH] fix(python): remove transport close from get_protocol --- python/src/trezorlib/client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/src/trezorlib/client.py b/python/src/trezorlib/client.py index 949d8c2f42..989527f6bb 100644 --- a/python/src/trezorlib/client.py +++ b/python/src/trezorlib/client.py @@ -218,11 +218,9 @@ class TrezorClient: def _get_protocol(self) -> Channel: protocol = ProtocolV1Channel(self.transport, mapping.DEFAULT_MAPPING) - protocol.write(messages.Initialize()) - response = protocol.read() - self.transport.close() + if isinstance(response, messages.Failure): if response.code == messages.FailureType.InvalidProtocol: LOG.debug("Protocol V2 detected")