From 1fa4f1eb81920ccd87caca5d70de301747db046a Mon Sep 17 00:00:00 2001 From: slush Date: Sat, 31 Aug 2013 23:45:53 +0200 Subject: [PATCH] Test if USB device is presented --- cmd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd.py b/cmd.py index 246f77b916..cdfe2d81c4 100755 --- a/cmd.py +++ b/cmd.py @@ -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)