[Pcsclite-cvs-commit] r3448 - /trunk/PCSC/UnitaryTests/SCardCancel.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Apr 14 14:01:09 UTC 2009


Author: rousseau
Date: Tue Apr 14 14:01:08 2009
New Revision: 3448

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3448
Log:
DeprecationWarning: raising a string exception is deprecated

Modified:
    trunk/PCSC/UnitaryTests/SCardCancel.py

Modified: trunk/PCSC/UnitaryTests/SCardCancel.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/SCardCancel.py?rev=3448&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/SCardCancel.py (original)
+++ trunk/PCSC/UnitaryTests/SCardCancel.py Tue Apr 14 14:01:08 2009
@@ -31,11 +31,11 @@
 
 hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
 if hresult!=0:
-	raise  'Failed to establish context: ' + SCardGetErrorMessage(hresult)
+	raise Exception('Failed to establish context: ' + SCardGetErrorMessage(hresult))
 
 hresult, readers = SCardListReaders(hcontext, [])
 if hresult!=0:
-	raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult)
+	raise Exception('Failed to list readers: ' + SCardGetErrorMessage(hresult))
 print 'PC/SC Readers:', readers
 
 readerstates = {}
@@ -43,7 +43,7 @@
     readerstates[reader] = (reader, SCARD_STATE_UNAWARE)
 hresult, newstates = SCardGetStatusChange(hcontext, 0, readerstates.values())
 if hresult!=SCARD_S_SUCCESS:
-    raise  'Failed to SCardGetStatusChange: ' + SCardGetErrorMessage(hresult)
+    raise Exception('Failed to SCardGetStatusChange: ' + SCardGetErrorMessage(hresult))
 print newstates
 for state in newstates:
     readername, eventstate, atr = state
@@ -54,9 +54,9 @@
 
 hresult, newstates = SCardGetStatusChange(hcontext, 10000, readerstates.values())
 if hresult!=SCARD_S_SUCCESS and hresult!=SCARD_E_TIMEOUT:
-    raise  'Failed to SCardGetStatusChange: ' + SCardGetErrorMessage(hresult)
+    raise Exception('Failed to SCardGetStatusChange: ' + SCardGetErrorMessage(hresult))
 
 hresult = SCardReleaseContext(hcontext)
 if hresult!=SCARD_S_SUCCESS:
-	raise  'Failed to release context: ' + SCardGetErrorMessage(hresult)
+	raise Exception('Failed to release context: ' + SCardGetErrorMessage(hresult))
 




More information about the Pcsclite-cvs-commit mailing list