ref: ab590670d9f766f9054ed09af6f5afc3daed960e
parent: c997036f26496bfa22e4ded4955dacdd38c71b9a
author: Paul Brossier <piem@piem.org>
date: Sun Jul 15 11:08:19 EDT 2012
aubiowraphell.h: add remove unused AUBIO_NEW, set expection and string when new_aubio_ returns NULL
--- a/interfaces/python/aubiowraphell.h
+++ b/interfaces/python/aubiowraphell.h
@@ -7,15 +7,6 @@
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) \
@@ -22,6 +13,7 @@
{ \
self->o = new_aubio_## NAME ( PARAMS ); \
if (self->o == NULL) { \
+ PyErr_SetString (PyExc_StandardError, "error creating object"); \
return -1; \
} \
\