Fix displaying error message if pycvc is missing.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-10-29 11:35:54 +02:00
parent 4536589e2c
commit 3835507e00

View File

@@ -24,7 +24,6 @@ try:
from smartcard.CardType import AnyCardType from smartcard.CardType import AnyCardType
from smartcard.CardRequest import CardRequest from smartcard.CardRequest import CardRequest
from smartcard.Exceptions import CardRequestTimeoutException from smartcard.Exceptions import CardRequestTimeoutException
from cvc.certificates import CVC
except: except:
print('ERROR: smarctard module not found! Install pyscard package.\nTry with `pip install pyscard`') print('ERROR: smarctard module not found! Install pyscard package.\nTry with `pip install pyscard`')
sys.exit(-1) sys.exit(-1)
@@ -33,6 +32,7 @@ try:
from cvc.asn1 import ASN1 from cvc.asn1 import ASN1
from cvc.oid import oid2scheme from cvc.oid import oid2scheme
from cvc.utils import scheme_rsa from cvc.utils import scheme_rsa
from cvc.certificates import CVC
from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.asymmetric import ec
except: except:
print('ERROR: cvc module not found! Install pycvc package.\nTry with `pip install pycvc`') print('ERROR: cvc module not found! Install pycvc package.\nTry with `pip install pycvc`')