History

[py] raise an exception when reading source failed

Paul Brossier committed 7 years ago

Commit 519d5d31 parent fc633f31 file · +8 −0Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/ext/py-source.c+8−0
@@ -436,6 +436,10 @@ Py_source_do(Py_source * self, PyObject * args) · 435 unmodified lines
436436 /* compute _do function */
437437 aubio_source_do (self->o, &(self->c_read_to), &read);
438438
439+ if (PyErr_Occurred() != NULL) {
440+ return NULL;
441+ }
442+
439443 outputs = PyTuple_New(2);
440444 PyTuple_SetItem( outputs, 0, self->read_to );
441445 PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));
@@ -457,6 +461,10 @@ Py_source_do_multi(Py_source * self, PyObject * args) · 15 unmodified lines
457461 /* compute _do function */
458462 aubio_source_do_multi (self->o, &(self->c_mread_to), &read);
459463
464+ if (PyErr_Occurred() != NULL) {
465+ return NULL;
466+ }
467+
460468 outputs = PyTuple_New(2);
461469 PyTuple_SetItem( outputs, 0, self->mread_to);
462470 PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t