diff --git a/ledgerblue/comm.py b/ledgerblue/comm.py index e6c9cdc..9b03f87 100644 --- a/ledgerblue/comm.py +++ b/ledgerblue/comm.py @@ -300,16 +300,13 @@ def getDongle(debug=False): return DongleBLE(debug) elif PCSC is not None: # Use the first pcsc reader with a card inserted - connection = None for reader in readers(): try: connection = reader.createConnection() connection.connect() + return DongleSmartcard(connection, debug) except Exception: - connection = None pass - if connection is not None: - return DongleSmartcard(connection, debug) else: # USB HID by default dev = None