Showing the changes to python/ext (1 of 1 file). Show all
Unified · Split
| @@ -436,6 +436,10 @@ Py_source_do(Py_source * self, PyObject * args) · 435 unmodified lines | ||
| 436 | 436 | /* compute _do function */ |
| 437 | 437 | aubio_source_do (self->o, &(self->c_read_to), &read); |
| 438 | 438 | |
| 439 | + if (PyErr_Occurred() != NULL) { | |
| 440 | + return NULL; | |
| 441 | + } | |
| 442 | + | |
| 439 | 443 | outputs = PyTuple_New(2); |
| 440 | 444 | PyTuple_SetItem( outputs, 0, self->read_to ); |
| 441 | 445 | PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read)); |
| @@ -457,6 +461,10 @@ Py_source_do_multi(Py_source * self, PyObject * args) · 15 unmodified lines | ||
| 457 | 461 | /* compute _do function */ |
| 458 | 462 | aubio_source_do_multi (self->o, &(self->c_mread_to), &read); |
| 459 | 463 | |
| 464 | + if (PyErr_Occurred() != NULL) { | |
| 465 | + return NULL; | |
| 466 | + } | |
| 467 | + | |
| 460 | 468 | outputs = PyTuple_New(2); |
| 461 | 469 | PyTuple_SetItem( outputs, 0, self->mread_to); |
| 462 | 470 | PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read)); |