mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
Test if USB device is presented
This commit is contained in:
parent
8f42da3fcc
commit
1fa4f1eb81
5
cmd.py
5
cmd.py
@ -44,7 +44,10 @@ def get_transport(transport_string, path):
|
|||||||
from bitkeylib.transport_hid import HidTransport
|
from bitkeylib.transport_hid import HidTransport
|
||||||
|
|
||||||
if path == '':
|
if path == '':
|
||||||
path = list_usb()[0]
|
try:
|
||||||
|
path = list_usb()[0]
|
||||||
|
except IndexError:
|
||||||
|
raise Exception("No Trezor found on USB")
|
||||||
|
|
||||||
return HidTransport(path)
|
return HidTransport(path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user