Allow exceptions from other cdef functions.
authorW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 00:26:22 +0000 (20:26 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 00:26:22 +0000 (20:26 -0400)
pycomedi/calibration.pyx
pycomedi/channel.pyx
pycomedi/command.pyx
pycomedi/subdevice.pxd
pycomedi/subdevice.pyx

index a3183e522367eb9080e1a9f6e71e5ab391cb877b..18b776820a691c176f627eff267b14b195febe32 100644 (file)
@@ -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
index b71129f0d7bd7cf05e097cc7902f0d3591b710e9..825744e277098cc9dfa5e8a585bc2bf5bcede732 100644 (file)
@@ -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):
index 8b087389f1f2fe7accda20a70bd9d7edf028e199..38d818dc5ba3d9ac22603dbab0f345063e9ae14c 100644 (file)
@@ -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):
index a67790c628c0d14e9b2a0617ca1f094e315d296d..31ef7725e50526ca762d9c8b4644971fcfc80344 100644 (file)
@@ -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):
index 2e4ef0cf0517fb484434581823ec727464f912b8..425c5b97b3fa35c4cc90e836ea34bc007d1702a4 100644 (file)
@@ -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):