shithub: aubio

Download patch

ref: 519d5d30fc1b3722802cc7c8821823eb6bbce25a
parent: fc633f3e1c4c6cfe64fd93279b3f2720e7909536
author: Paul Brossier <piem@piem.org>
date: Fri Dec 21 11:41:30 EST 2018

[py] raise an exception when reading source failed

--- a/python/ext/py-source.c
+++ b/python/ext/py-source.c
@@ -436,6 +436,10 @@
   /* compute _do function */
   aubio_source_do (self->o, &(self->c_read_to), &read);
 
+  if (PyErr_Occurred() != NULL) {
+    return NULL;
+  }
+
   outputs = PyTuple_New(2);
   PyTuple_SetItem( outputs, 0, self->read_to );
   PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));
@@ -456,6 +460,10 @@
   }
   /* compute _do function */
   aubio_source_do_multi (self->o, &(self->c_mread_to), &read);
+
+  if (PyErr_Occurred() != NULL) {
+    return NULL;
+  }
 
   outputs = PyTuple_New(2);
   PyTuple_SetItem( outputs, 0, self->mread_to);