Skip to content

Commit

Permalink
sample_pinpad.py: catch PCSC exceptions
Browse files Browse the repository at this point in the history
If we get a PC/C expcetion, like "scard exception: No smart card
inserted. (0x8010000C)", we just continue with the next reader.
  • Loading branch information
LudovicRousseau committed Mar 2, 2023
1 parent cb305da commit b9bb295
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smartcard/Examples/scard-api/sample_pinpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def verifypin(hCard, control=None):
raise BaseSCardException(hresult)
print('Disconnected')

except error as message:
print(error, message)
except BaseSCardException as ex:
print("SCard Exception:", ex)

finally:
hresult = SCardReleaseContext(hcontext)
Expand Down

0 comments on commit b9bb295

Please sign in to comment.