mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
Revert "feat(python): give the emulator a little more time to respond to ping"
This reverts commit ae0da5e245
.
It seems that there was no good reason for the change in the first
place.
This commit is contained in:
parent
7e0e24430c
commit
34047cf3ec
@ -1 +0,0 @@
|
|||||||
Wait up to 1 second for emulator responses.
|
|
@ -24,7 +24,6 @@ from . import TransportException
|
|||||||
from .protocol import ProtocolBasedTransport, ProtocolV1
|
from .protocol import ProtocolBasedTransport, ProtocolV1
|
||||||
|
|
||||||
SOCKET_TIMEOUT = 10
|
SOCKET_TIMEOUT = 10
|
||||||
TRY_PATH_TIMEOUT = 1
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -60,12 +59,15 @@ class UdpTransport(ProtocolBasedTransport):
|
|||||||
def _try_path(cls, path: str) -> "UdpTransport":
|
def _try_path(cls, path: str) -> "UdpTransport":
|
||||||
d = cls(path)
|
d = cls(path)
|
||||||
try:
|
try:
|
||||||
d.wait_until_ready(timeout=TRY_PATH_TIMEOUT)
|
d.open()
|
||||||
|
if d._ping():
|
||||||
return d
|
return d
|
||||||
except Exception as e:
|
else:
|
||||||
raise TransportException(
|
raise TransportException(
|
||||||
"No Trezor device found at address {}".format(d.get_path())
|
"No Trezor device found at address {}".format(d.get_path())
|
||||||
) from e
|
)
|
||||||
|
finally:
|
||||||
|
d.close()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def enumerate(cls) -> Iterable["UdpTransport"]:
|
def enumerate(cls) -> Iterable["UdpTransport"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user