From 2e1085f7bc015212a37a2f6e69ae50a5768b52a7 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 dd331fe62e..7af36e54d3 100644 --- a/python/src/trezorlib/client.py +++ b/python/src/trezorlib/client.py @@ -187,11 +187,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")