From: W. Trevor King Date: Sat, 20 Oct 2012 00:26:22 +0000 (-0400) Subject: Allow exceptions from other cdef functions. X-Git-Tag: 0.6~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3645a503ce202da6601339efd227645cfb1e0b0d;p=pycomedi.git Allow exceptions from other cdef functions. --- diff --git a/pycomedi/calibration.pyx b/pycomedi/calibration.pyx index a3183e5..18b7768 100644 --- a/pycomedi/calibration.pyx +++ b/pycomedi/calibration.pyx @@ -33,7 +33,8 @@ import constant as _constant import utility as _utility -cdef void _python_to_charp(char **charp, object obj, object encoding): +cdef void _python_to_charp( + char **charp, object obj, object encoding) except *: """Convert a Python string into a `char *`. Cython automatically converts string or byte array to a `char *` @@ -58,7 +59,8 @@ cdef void _python_to_charp(char **charp, object obj, object encoding): charp[0] = ret cdef void _setup_comedi_polynomial_t( - _comedilib_h.comedi_polynomial_t *p, coefficients, expansion_origin): + _comedilib_h.comedi_polynomial_t *p, coefficients, expansion_origin + ) except *: """Setup the `comedi_polynomial_t` at `p` * `coefficients` is an iterable containing polynomial coefficients diff --git a/pycomedi/channel.pyx b/pycomedi/channel.pyx index b71129f..825744e 100644 --- a/pycomedi/channel.pyx +++ b/pycomedi/channel.pyx @@ -69,7 +69,7 @@ cdef class Channel (object): self.subdevice = subdevice self.index = index - cdef _comedilib_h.comedi_t * _device(self): + cdef _comedilib_h.comedi_t * _device(self) except *: return <_comedilib_h.comedi_t *> self.subdevice.device.device def get_maxdata(self): diff --git a/pycomedi/command.pyx b/pycomedi/command.pyx index 8b08738..38d818d 100644 --- a/pycomedi/command.pyx +++ b/pycomedi/command.pyx @@ -144,7 +144,7 @@ cdef class Command (object): if self._cmd.data is not NULL: _stdlib.free(self._cmd.data) - cdef _comedi_h.comedi_cmd *get_comedi_cmd_pointer(self): + cdef _comedi_h.comedi_cmd *get_comedi_cmd_pointer(self) except *: return &self._cmd def __str__(self): diff --git a/pycomedi/subdevice.pxd b/pycomedi/subdevice.pxd index a67790c..31ef772 100644 --- a/pycomedi/subdevice.pxd +++ b/pycomedi/subdevice.pxd @@ -24,7 +24,7 @@ cdef class Subdevice (object): cdef public object device # pycomedi.device.Device cdef public int index - cdef _comedilib_h.comedi_t * _device(self) + cdef _comedilib_h.comedi_t * _device(self) except * cpdef dio_bitfield(self, unsigned int bits=*, write_mask=*, base_channel=*) cdef class StreamingSubdevice (Subdevice): diff --git a/pycomedi/subdevice.pyx b/pycomedi/subdevice.pyx index 2e4ef0c..425c5b9 100644 --- a/pycomedi/subdevice.pyx +++ b/pycomedi/subdevice.pyx @@ -74,7 +74,7 @@ cdef class Subdevice (object): self.device = device self.index = index - cdef _comedilib_h.comedi_t * _device(self): + cdef _comedilib_h.comedi_t * _device(self) except *: return <_comedilib_h.comedi_t *> self.device.device def get_type(self):