mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-04-01 00:25:55 +03:00
ModemATCommandLink: fix AttributeError exception in __del__()
self._sl will not be assigned if serial.Serial() fails. Change-Id: I179a7efd92eaa3469a17b6ef252b3949c44ea6ea
This commit is contained in:
@@ -43,6 +43,7 @@ class ModemATCommandLink(LinkBase):
|
|||||||
self.reset_card()
|
self.reset_card()
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
if hasattr(self, '_sl'):
|
||||||
self._sl.close()
|
self._sl.close()
|
||||||
|
|
||||||
def send_at_cmd(self, cmd, timeout=0.2, patience=0.002):
|
def send_at_cmd(self, cmd, timeout=0.2, patience=0.002):
|
||||||
|
|||||||
Reference in New Issue
Block a user