Fix error when _cs is None during teardown

test2
Zach Riggle 10 years ago
parent c42effd51c
commit 1b293064f6
  1. 2
      bindings/python/capstone/__init__.py

@ -728,7 +728,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)

Loading…
Cancel
Save