mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-09 10:28:46 +00:00
fix(python): remove transport close from get_protocol
This commit is contained in:
parent
97218ec49f
commit
acbb553e1d
@ -187,11 +187,9 @@ class TrezorClient:
|
|||||||
|
|
||||||
def _get_protocol(self) -> Channel:
|
def _get_protocol(self) -> Channel:
|
||||||
protocol = ProtocolV1Channel(self.transport, mapping.DEFAULT_MAPPING)
|
protocol = ProtocolV1Channel(self.transport, mapping.DEFAULT_MAPPING)
|
||||||
|
|
||||||
protocol.write(messages.Initialize())
|
protocol.write(messages.Initialize())
|
||||||
|
|
||||||
response = protocol.read()
|
response = protocol.read()
|
||||||
self.transport.close()
|
|
||||||
if isinstance(response, messages.Failure):
|
if isinstance(response, messages.Failure):
|
||||||
if response.code == messages.FailureType.InvalidProtocol:
|
if response.code == messages.FailureType.InvalidProtocol:
|
||||||
LOG.debug("Protocol V2 detected")
|
LOG.debug("Protocol V2 detected")
|
||||||
|
Loading…
Reference in New Issue
Block a user