From: Paul Brossier Date: Sun, 15 Jul 2012 21:08:19 +0000 (-0600) Subject: aubiowraphell.h: add remove unused AUBIO_NEW, set expection and string when new_aubio... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ab590670d9f766f9054ed09af6f5afc3daed960e;p=aubio.git aubiowraphell.h: add remove unused AUBIO_NEW, set expection and string when new_aubio_ returns NULL --- diff --git a/interfaces/python/aubiowraphell.h b/interfaces/python/aubiowraphell.h index 7ccdc096..d60cc30a 100644 --- a/interfaces/python/aubiowraphell.h +++ b/interfaces/python/aubiowraphell.h @@ -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; \ } \ \