Skip to content

Commit

Permalink
Revert "feat(python): give the emulator a little more time to respond…
Browse files Browse the repository at this point in the history
… to ping"

This reverts commit ae0da5e.

It seems that there was no good reason for the change in the first
place.
  • Loading branch information
matejcik committed Jul 30, 2021
1 parent 0788484 commit e1cc3f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion python/.changelog.d/1565.added

This file was deleted.

16 changes: 9 additions & 7 deletions python/src/trezorlib/transport/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from .protocol import ProtocolBasedTransport, ProtocolV1

SOCKET_TIMEOUT = 10
TRY_PATH_TIMEOUT = 1

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -60,12 +59,15 @@ def find_debug(self) -> "UdpTransport":
def _try_path(cls, path: str) -> "UdpTransport":
d = cls(path)
try:
d.wait_until_ready(timeout=TRY_PATH_TIMEOUT)
return d
except Exception as e:
raise TransportException(
"No Trezor device found at address {}".format(d.get_path())
) from e
d.open()
if d._ping():
return d
else:
raise TransportException(
"No Trezor device found at address {}".format(d.get_path())
)
finally:
d.close()

@classmethod
def enumerate(cls) -> Iterable["UdpTransport"]:
Expand Down

0 comments on commit e1cc3f1

Please sign in to comment.