History

[py] improve digital_filter error messages (closes #gh-241)

Paul Brossier committed 7 years ago

Commit 8bfef301 parent 22e3ef11 file · +12 −6Browse files

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

Unified · Split

python/ext/py-filter.c+12−6
@@ -156,8 +156,10 @@ Py_filter_set_c_weighting (Py_filter * self, PyObject *args) · 155 unmodified lines
156 156
157 err = aubio_filter_set_c_weighting (self->o, samplerate);157 err = aubio_filter_set_c_weighting (self->o, samplerate);
158 if (err > 0) {158 if (err > 0) {
159 PyErr_SetString (PyExc_ValueError,159 if (PyErr_Occurred() == NULL) {
160 "error when setting filter to C-weighting");160 PyErr_SetString (PyExc_ValueError,
161 "error when setting filter to C-weighting");
162 }
161 return NULL;163 return NULL;
162 }164 }
163 Py_RETURN_NONE;165 Py_RETURN_NONE;
@@ -174,8 +176,10 @@ Py_filter_set_a_weighting (Py_filter * self, PyObject *args) · 10 unmodified lines
174 176
175 err = aubio_filter_set_a_weighting (self->o, samplerate);177 err = aubio_filter_set_a_weighting (self->o, samplerate);
176 if (err > 0) {178 if (err > 0) {
177 PyErr_SetString (PyExc_ValueError,179 if (PyErr_Occurred() == NULL) {
178 "error when setting filter to A-weighting");180 PyErr_SetString (PyExc_ValueError,
181 "error when setting filter to A-weighting");
182 }
179 return NULL;183 return NULL;
180 }184 }
181 Py_RETURN_NONE;185 Py_RETURN_NONE;
@@ -192,8 +196,10 @@ Py_filter_set_biquad(Py_filter * self, PyObject *args) · 10 unmodified lines
192 196
193 err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2);197 err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2);
194 if (err > 0) {198 if (err > 0) {
195 PyErr_SetString (PyExc_ValueError,199 if (PyErr_Occurred() == NULL) {
196 "error when setting filter with biquad coefficients");200 PyErr_SetString (PyExc_ValueError,
201 "error when setting filter with biquad coefficients");
202 }
197 return NULL;203 return NULL;
198 }204 }
199 Py_RETURN_NONE;205 Py_RETURN_NONE;

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