Changes in / [e3fde21:841ceed]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-filter.c
re3fde21 r841ceed 157 157 err = aubio_filter_set_c_weighting (self->o, samplerate); 158 158 if (err > 0) { 159 PyErr_SetString (PyExc_ValueError, 160 "error when setting filter to C-weighting"); 159 if (PyErr_Occurred() == NULL) { 160 PyErr_SetString (PyExc_ValueError, 161 "error when setting filter to C-weighting"); 162 } else { 163 // change the RuntimeError into ValueError 164 PyObject *type, *value, *traceback; 165 PyErr_Fetch(&type, &value, &traceback); 166 PyErr_Restore(PyExc_ValueError, value, traceback); 167 } 161 168 return NULL; 162 169 } … … 175 182 err = aubio_filter_set_a_weighting (self->o, samplerate); 176 183 if (err > 0) { 177 PyErr_SetString (PyExc_ValueError, 178 "error when setting filter to A-weighting"); 184 if (PyErr_Occurred() == NULL) { 185 PyErr_SetString (PyExc_ValueError, 186 "error when setting filter to A-weighting"); 187 } else { 188 // change the RuntimeError into ValueError 189 PyObject *type, *value, *traceback; 190 PyErr_Fetch(&type, &value, &traceback); 191 PyErr_Restore(PyExc_ValueError, value, traceback); 192 } 179 193 return NULL; 180 194 } … … 193 207 err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2); 194 208 if (err > 0) { 195 PyErr_SetString (PyExc_ValueError, 196 "error when setting filter with biquad coefficients"); 209 if (PyErr_Occurred() == NULL) { 210 PyErr_SetString (PyExc_ValueError, 211 "error when setting filter with biquad coefficients"); 212 } else { 213 // change the RuntimeError into ValueError 214 PyObject *type, *value, *traceback; 215 PyErr_Fetch(&type, &value, &traceback); 216 PyErr_Restore(PyExc_ValueError, value, traceback); 217 } 197 218 return NULL; 198 219 }
Note: See TracChangeset
for help on using the changeset viewer.