Test if USB device is presented

This commit is contained in:
slush 2013-08-31 23:45:53 +02:00
parent 8f42da3fcc
commit 1fa4f1eb81
1 changed files with 4 additions and 1 deletions

5
cmd.py
View File

@ -44,7 +44,10 @@ def get_transport(transport_string, path):
from bitkeylib.transport_hid import HidTransport
if path == '':
path = list_usb()[0]
try:
path = list_usb()[0]
except IndexError:
raise Exception("No Trezor found on USB")
return HidTransport(path)