1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-17 19:00:58 +00:00

fix(python/trezorctl): re-enable trezorctl -p udp

[no changelog]
This commit is contained in:
matejcik 2023-03-23 14:53:41 +01:00
parent 07addae05f
commit fa7c818cfc

View File

@ -69,6 +69,9 @@ class UdpTransport(ProtocolBasedTransport):
raise TransportException( raise TransportException(
f"No Trezor device found at address {d.get_path()}" f"No Trezor device found at address {d.get_path()}"
) )
except Exception as e:
raise TransportException(f"Error opening {d.get_path()}") from e
finally: finally:
d.close() d.close()
@ -85,8 +88,8 @@ class UdpTransport(ProtocolBasedTransport):
@classmethod @classmethod
def find_by_path(cls, path: str, prefix_search: bool = False) -> "UdpTransport": def find_by_path(cls, path: str, prefix_search: bool = False) -> "UdpTransport":
try: try:
path = path.replace(f"{cls.PATH_PREFIX}:", "") address = path.replace(f"{cls.PATH_PREFIX}:", "")
return cls._try_path(path) return cls._try_path(address)
except TransportException: except TransportException:
if not prefix_search: if not prefix_search:
raise raise