aubiowraphell.h: add remove unused AUBIO_NEW, set expection and string when new_aubio...
authorPaul Brossier <piem@piem.org>
Sun, 15 Jul 2012 21:08:19 +0000 (15:08 -0600)
committerPaul Brossier <piem@piem.org>
Sun, 15 Jul 2012 21:08:19 +0000 (15:08 -0600)
interfaces/python/aubiowraphell.h

index 7ccdc09695d6fc6f3bf8229d60632a3bddfc5613..d60cc30ad7eafd138275c26b12923e13dacd381f 100644 (file)
@@ -7,21 +7,13 @@ typedef struct { \
   PARAMS; \
 } Py_## NAME;
 
-#define AUBIO_NEW(NAME) \
-static PyObject * \
-Py_ ## NAME ## _new (PyTypeObject * type, PyObject * args, PyObject * kwds) \
-{ \
-  Py_ ## NAME * self; \
-  self = (Py_ ## NAME *) type->tp_alloc (type, 0); \
-  return (PyObject *)self; \
-}
-
 #define AUBIO_INIT(NAME, PARAMS... ) \
 static int \
 Py_ ## NAME ## _init (Py_ ## NAME * self, PyObject * args, PyObject * kwds) \
 { \
   self->o = new_aubio_## NAME ( PARAMS ); \
   if (self->o == NULL) { \
+    PyErr_SetString (PyExc_StandardError, "error creating object"); \
     return -1; \
   } \
 \