1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-24 02:59:03 +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 4ec5389c11
commit b6c67b05e2

View File

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