shithub: aubio

Download patch

ref: 23982aa9ec2f22b67b8aca59cc69c8d1c1ad9c57
parent: fcef3fd331e30e57971e15bc90874c05688da9fb
author: Paul Brossier <piem@piem.org>
date: Tue May 3 13:40:36 EDT 2016

python/ext/py-fft.c: improve error message, dont delete if not created

--- a/python/ext/py-fft.c
+++ b/python/ext/py-fft.c
@@ -51,9 +51,11 @@
 {
   self->o = new_aubio_fft (self->win_s);
   if (self->o == NULL) {
-    char_t errstr[30];
-    sprintf(errstr, "error creating fft with win_s=%d", self->win_s);
-    PyErr_SetString (PyExc_Exception, errstr);
+    PyErr_Format(PyExc_RuntimeError,
+        "error creating fft with win_s=%d "
+        "(should be a power of 2 greater than 1; "
+        "try recompiling aubio with --enable-fftw3)",
+        self->win_s);
     return -1;
   }
 
@@ -68,7 +70,9 @@
 {
   Py_XDECREF(self->doout);
   Py_XDECREF(self->rdoout);
-  del_aubio_fft(self->o);
+  if (self->o) {
+    del_aubio_fft(self->o);
+  }
   Py_TYPE(self)->tp_free((PyObject *) self);
 }