Skip to content

Commit

Permalink
python: generator yields nothing rather than [] on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jan 13, 2014
1 parent cf4df4b commit e14556a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bindings/python/capstone/capstone.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,11 @@ def cs_disasm_quick(arch, mode, code, offset, count = 0):

_cs.cs_free(all_insn, res)
else:
yield []
status = _cs.cs_errno(csh)
if status != CS_ERR_OK:
raise CsError(status)
return
yield

status = _cs.cs_close(csh)
if status != CS_ERR_OK:
Expand Down Expand Up @@ -458,8 +459,9 @@ def disasm(self, code, offset, count = 0):
yield CsInsn(self, all_insn[i])
_cs.cs_free(all_insn, res)
else:
yield []
status = _cs.cs_errno(self.csh)
if status != CS_ERR_OK:
raise CsError(status)
return
yield

0 comments on commit e14556a

Please sign in to comment.