Changeset 8bfef30


Ignore:
Timestamp:
Mar 26, 2019, 3:17:05 PM (16 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/timestretch, master
Children:
11c46c8
Parents:
22e3ef1
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-filter.c

    r22e3ef1 r8bfef30  
    157157  err = aubio_filter_set_c_weighting (self->o, samplerate);
    158158  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    }
    161163    return NULL;
    162164  }
     
    175177  err = aubio_filter_set_a_weighting (self->o, samplerate);
    176178  if (err > 0) {
    177     PyErr_SetString (PyExc_ValueError,
    178         "error when setting filter to A-weighting");
     179    if (PyErr_Occurred() == NULL) {
     180      PyErr_SetString (PyExc_ValueError,
     181          "error when setting filter to A-weighting");
     182    }
    179183    return NULL;
    180184  }
     
    193197  err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2);
    194198  if (err > 0) {
    195     PyErr_SetString (PyExc_ValueError,
    196         "error when setting filter with biquad coefficients");
     199    if (PyErr_Occurred() == NULL) {
     200      PyErr_SetString (PyExc_ValueError,
     201          "error when setting filter with biquad coefficients");
     202    }
    197203    return NULL;
    198204  }
Note: See TracChangeset for help on using the changeset viewer.