Fix error when _cs is None during teardown

This commit is contained in:
Zach Riggle 2015-05-09 16:06:48 -04:00 committed by Nguyen Anh Quynh
parent a34b231220
commit a10fbb2b3f
1 changed files with 1 additions and 1 deletions

View File

@ -692,7 +692,7 @@ class Cs(object):
# destructor to be called automatically when object is destroyed.
def __del__(self):
if self.csh:
if self.csh and _cs is not None:
status = _cs.cs_close(ctypes.byref(self.csh))
if status != CS_ERR_OK:
raise CsError(status)