From 22d578c238084d1a36b76c8e55d0a31a6e595e88 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 15 Mar 2018 13:06:21 +0100 Subject: [PATCH] fix #4082 --- plugins/trezor/trezor.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/plugins/trezor/trezor.py b/plugins/trezor/trezor.py index 24d76692698a..7282b937c851 100644 --- a/plugins/trezor/trezor.py +++ b/plugins/trezor/trezor.py @@ -131,11 +131,28 @@ def enumerate(self): except ImportError: # compat for trezorlib < 0.9.2 def all_transports(): - from trezorlib.transport_bridge import BridgeTransport - from trezorlib.transport_hid import HidTransport - from trezorlib.transport_udp import UdpTransport - from trezorlib.transport_webusb import WebUsbTransport - return (BridgeTransport, HidTransport, UdpTransport, WebUsbTransport) + transports = [] + try: + from trezorlib.transport_bridge import BridgeTransport + transports.append(BridgeTransport) + except BaseException: + pass + try: + from trezorlib.transport_hid import HidTransport + transports.append(HidTransport) + except BaseException: + pass + try: + from trezorlib.transport_udp import UdpTransport + transports.append(UdpTransport) + except BaseException: + pass + try: + from trezorlib.transport_webusb import WebUsbTransport + transports.append(WebUsbTransport) + except BaseException: + pass + return transports devices = [] for transport in all_transports():