1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-12 14:16:06 +00:00

fix(python): remove transport close from get_protocol

This commit is contained in:
M1nd3r 2025-03-11 11:25:37 +01:00
parent 50c9c6aa9b
commit 28eaa8552d

View File

@ -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")