changeset 424:295e803f6a5e

dmx.pyx fixes for new stricter pyrex
author drewp@bigasterisk.com
date Tue, 10 Jun 2008 04:12:05 +0000
parents 2b2f5da47c5d
children 8713617cc08e
files dmx_usb_module/dmx.pyx
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dmx_usb_module/dmx.pyx	Mon Jun 09 07:07:10 2008 +0000
+++ b/dmx_usb_module/dmx.pyx	Tue Jun 10 04:12:05 2008 +0000
@@ -13,7 +13,7 @@
 
 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 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")