add library not found error

This commit is contained in:
merlokk 2019-07-02 19:45:46 +03:00
parent 2c500fe25a
commit d1722b85af

View File

@ -68,14 +68,14 @@ class Tester:
dev = next(CtapHidDevice.list_devices(), None) dev = next(CtapHidDevice.list_devices(), None)
if not dev: if not dev:
try: try:
if 'pyscard' not in sys.modules:
print('You have not installed pyscard module')
from fido2.nfc import CtapNfcDevice from fido2.nfc import CtapNfcDevice
print("--- NFC ---") print("--- NFC ---")
print(list(CtapNfcDevice.list_devices())) print(list(CtapNfcDevice.list_devices()))
dev = next(CtapNfcDevice.list_devices(), None) dev = next(CtapNfcDevice.list_devices(), None)
except: except ModuleNotFoundError:
print("NFC devices is not supported") print("One of NFC library is not installed properly.")
except Exception as e:
print("NFC devices is not supported", e, e.__class__.__name__)
if not dev: if not dev:
raise RuntimeError("No FIDO device found") raise RuntimeError("No FIDO device found")
self.dev = dev self.dev = dev