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
436 /* compute _do function */436 /* compute _do function */
437 aubio_source_do (self->o, &(self->c_read_to), &read);437 aubio_source_do (self->o, &(self->c_read_to), &read);
438 438
439 if (PyErr_Occurred() != NULL) {
440 return NULL;
441 }
442
439 outputs = PyTuple_New(2);443 outputs = PyTuple_New(2);
440 PyTuple_SetItem( outputs, 0, self->read_to );444 PyTuple_SetItem( outputs, 0, self->read_to );
441 PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));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 /* compute _do function */461 /* compute _do function */
458 aubio_source_do_multi (self->o, &(self->c_mread_to), &read);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 outputs = PyTuple_New(2);468 outputs = PyTuple_New(2);
461 PyTuple_SetItem( outputs, 0, self->mread_to);469 PyTuple_SetItem( outputs, 0, self->mread_to);
462 PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));470 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