mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 01:19:37 +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,7 +43,8 @@ class ModemATCommandLink(LinkBase):
|
|||||||
self.reset_card()
|
self.reset_card()
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self._sl.close()
|
if hasattr(self, '_sl'):
|
||||||
|
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):
|
||||||
# Convert from string to bytes, if needed
|
# Convert from string to bytes, if needed
|
||||||
|
|||||||
Reference in New Issue
Block a user