From: W. Trevor King Date: Mon, 19 Mar 2012 16:10:18 +0000 (-0400) Subject: Fix error condition `ret < 0` -> `ret < len(insnlist)` for Device.do_insnlist. X-Git-Tag: 0.5~28 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b1b5632e4a4cc909cb0c0fb062082d10a536f9a;p=pycomedi.git Fix error condition `ret < 0` -> `ret < len(insnlist)` for Device.do_insnlist. The previous implemenation would apparently succeed if there was an error executing an instruction. It would only raise an exception if a failure occured before the first instruction could be executed. --- diff --git a/pycomedi/device.pyx b/pycomedi/device.pyx index b5ef683..bdff315 100644 --- a/pycomedi/device.pyx +++ b/pycomedi/device.pyx @@ -243,7 +243,7 @@ cdef class Device (object): ret = _comedilib_h.comedi_do_insnlist(self.device, &il) finally: _stdlib.free(il.insns) - if ret < 0: + if ret < len(insnlist): _error.raise_error(function_name='comedi_do_insnlist', ret=ret) return ret