From fa7c818cfc376b46c2ee1d1d3c8d5400d0dc0de1 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 23 Mar 2023 14:53:41 +0100 Subject: [PATCH] fix(python/trezorctl): re-enable `trezorctl -p udp` [no changelog] --- python/src/trezorlib/transport/udp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/src/trezorlib/transport/udp.py b/python/src/trezorlib/transport/udp.py index f305a77c29..7e4c4614c6 100644 --- a/python/src/trezorlib/transport/udp.py +++ b/python/src/trezorlib/transport/udp.py @@ -69,6 +69,9 @@ class UdpTransport(ProtocolBasedTransport): raise TransportException( 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: d.close() @@ -85,8 +88,8 @@ class UdpTransport(ProtocolBasedTransport): @classmethod def find_by_path(cls, path: str, prefix_search: bool = False) -> "UdpTransport": try: - path = path.replace(f"{cls.PATH_PREFIX}:", "") - return cls._try_path(path) + address = path.replace(f"{cls.PATH_PREFIX}:", "") + return cls._try_path(address) except TransportException: if not prefix_search: raise