# HG changeset patch # User drewp@bigasterisk.com # Date 2008-06-10 04:12:05 # Node ID 295e803f6a5ea38d962965a40f5aff1db3276638 # Parent 2b2f5da47c5db09388f0de8b6f1cbbbb05f37e68 dmx.pyx fixes for new stricter pyrex diff --git a/dmx_usb_module/dmx.pyx b/dmx_usb_module/dmx.pyx --- a/dmx_usb_module/dmx.pyx +++ b/dmx_usb_module/dmx.pyx @@ -13,7 +13,7 @@ cdef extern from "Python.h": cdef class Dmx: cdef int fd - def __new__(self, port="/dev/dmx0"): + def __cinit__(self, port="/dev/dmx0"): self.fd = open(port, O_WRONLY) if self.fd < 0: raise OSError("open failed") @@ -22,7 +22,7 @@ cdef class Dmx: cdef char *cbuf cbuf = PyString_AsString(buf) if cbuf == NULL: - raise + raise ValueError("string buffer conversion failed") res = write(self.fd, cbuf, 513) if res < 0: raise OSError("write failed")