Ignore:
Timestamp:
Jun 29, 2019, 1:14:08 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
Children:
3a83821
Parents:
9279ba0 (diff), 2244f00 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/timestretch

File:
1 edited

Legend:

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

    r9279ba0 r08d07ce  
    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    } else {
     163      // change the RuntimeError into ValueError
     164      PyObject *type, *value, *traceback;
     165      PyErr_Fetch(&type, &value, &traceback);
     166      Py_XDECREF(type);
     167      type = PyExc_ValueError;
     168      Py_XINCREF(type);
     169      PyErr_Restore(type, value, traceback);
     170    }
    161171    return NULL;
    162172  }
     
    175185  err = aubio_filter_set_a_weighting (self->o, samplerate);
    176186  if (err > 0) {
    177     PyErr_SetString (PyExc_ValueError,
    178         "error when setting filter to A-weighting");
     187    if (PyErr_Occurred() == NULL) {
     188      PyErr_SetString (PyExc_ValueError,
     189          "error when setting filter to A-weighting");
     190    } else {
     191      // change the RuntimeError into ValueError
     192      PyObject *type, *value, *traceback;
     193      PyErr_Fetch(&type, &value, &traceback);
     194      Py_XDECREF(type);
     195      type = PyExc_ValueError;
     196      Py_XINCREF(type);
     197      PyErr_Restore(type, value, traceback);
     198    }
    179199    return NULL;
    180200  }
     
    193213  err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2);
    194214  if (err > 0) {
    195     PyErr_SetString (PyExc_ValueError,
    196         "error when setting filter with biquad coefficients");
     215    if (PyErr_Occurred() == NULL) {
     216      PyErr_SetString (PyExc_ValueError,
     217          "error when setting filter with biquad coefficients");
     218    } else {
     219      // change the RuntimeError into ValueError
     220      PyObject *type, *value, *traceback;
     221      PyErr_Fetch(&type, &value, &traceback);
     222      Py_XDECREF(type);
     223      type = PyExc_ValueError;
     224      Py_XINCREF(type);
     225      PyErr_Restore(type, value, traceback);
     226    }
    197227    return NULL;
    198228  }
Note: See TracChangeset for help on using the changeset viewer.