From 8b1b5632e4a4cc909cb0c0fb062082d10a536f9a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 19 Mar 2012 12:10:18 -0400 Subject: [PATCH] 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. --- pycomedi/device.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2