File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2424
2525import hid
2626import nfc
27- from smartcard .System import readers
28- from smartcard .util import toBytes
2927
3028from .BleComm import BleDevice
3129from .commException import CommException
6664if "LEDGER_BLE_PROXY" in os .environ :
6765 BLE_PROXY = True
6866
69- # Force use of MCUPROXY if required
7067PCSC = None
7168if "PCSC" in os .environ and len (os .environ ["PCSC" ]) != 0 :
7269 PCSC = os .environ ["PCSC" ]
70+ try :
71+ # Don't force all users to install pyscard
72+ from smartcard .System import readers
73+ except ImportError :
74+ PCSC = None
75+
7376
7477def get_possible_error_cause (sw ):
7578 cause_map = {
@@ -295,7 +298,7 @@ def getDongle(debug=False):
295298 return DongleNFC (debug )
296299 elif BLE_PROXY :
297300 return DongleBLE (debug )
298- elif PCSC :
301+ elif PCSC is not None :
299302 # Use the first pcsc reader with a card inserted
300303 connection = None
301304 for reader in readers ():
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ dependencies = [
4343 " nfcpy>=1.0.4" ,
4444 " bleak>=0.20.1" ,
4545 " pycryptodome>=3.18.0" ,
46- " python-gnupg>=0.5.0" ,
47- " pyscard>=2.2.2"
46+ " python-gnupg>=0.5.0"
4847]
4948
5049[tool .setuptools ]
You can’t perform that action at this time.
0 commit comments