From 119b92f9dcb61b0d76194a88f6bce891a6f10838 Mon Sep 17 00:00:00 2001 From: Yves Richard Date: Tue, 22 Jul 2025 13:39:33 +0200 Subject: [PATCH] Fix PCSC reader detection --- ledgerblue/comm.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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