Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/17283 )


Change subject: transport/pcsc: work around Python 3.5 bug: do not call 
disconnect()
......................................................................

transport/pcsc: work around Python 3.5 bug: do not call disconnect()

Unfortunately, Debian ships old Python (3.5 vs 3.8) and old pyscard
(1.9.4 vs 1.9.9). Calling PCSCCardConnection.disconnect() from a
destructor causes warnings about ignored exceptions:

  AttributeError: 'NoneType' object has no attribute 'disconnect'
  AttributeError: 'NoneType' object has no attribute 'setChanged'
  AttributeError: 'NoneType' object has no attribute 'SCardDisconnect'
  TypeError: 'NoneType' object is not callable

All these exceptions happen in pyscard's own destructors.

Change-Id: I9c644bc5fe9791b141a30bfc13647d77937a82ee
---
M pySim/transport/pcsc.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/83/17283/1

diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index 380c8fd..171d339 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -40,7 +40,7 @@
                self._con = self._reader.createConnection()

        def __del__(self):
-               self._con.disconnect()
+               del self._con
                return

        def wait_for_card(self, timeout=None, newcardonly=False):

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/17283
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I9c644bc5fe9791b141a30bfc13647d77937a82ee
Gerrit-Change-Number: 17283
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-MessageType: newchange

Reply via email to