Showing the changes to python (5 of 5 files). Show all
Unified · Split
| @@ -164,7 +164,7 @@ Py_min_removal(PyObject * self, PyObject * args) · 163 unmodified lines | ||
| 164 | 164 | fvec_min_removal (vec); |
| 165 | 165 | |
| 166 | 166 | // since this function does not return, we could return None |
| 167 | − //return Py_None; | |
| 167 | + //Py_RETURN_NONE; | |
| 168 | 168 | // however it is convenient to return the modified vector |
| 169 | 169 | return (PyObject *) PyAubio_CFvecToArray(vec); |
| 170 | 170 | // or even without converting it back to an array |
| @@ -99,7 +99,7 @@ Py_filter_set_c_weighting (Py_filter * self, PyObject *args) · 98 unmodified lines | ||
| 99 | 99 | "error when setting filter to C-weighting"); |
| 100 | 100 | return NULL; |
| 101 | 101 | } |
| 102 | − return Py_None; | |
| 102 | + Py_RETURN_NONE; | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static PyObject * |
| @@ -117,7 +117,7 @@ Py_filter_set_a_weighting (Py_filter * self, PyObject *args) · 11 unmodified lines | ||
| 117 | 117 | "error when setting filter to A-weighting"); |
| 118 | 118 | return NULL; |
| 119 | 119 | } |
| 120 | − return Py_None; | |
| 120 | + Py_RETURN_NONE; | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static PyObject * |
| @@ -135,7 +135,7 @@ Py_filter_set_biquad(Py_filter * self, PyObject *args) · 11 unmodified lines | ||
| 135 | 135 | "error when setting filter with biquad coefficients"); |
| 136 | 136 | return NULL; |
| 137 | 137 | } |
| 138 | − return Py_None; | |
| 138 | + Py_RETURN_NONE; | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static PyMemberDef Py_filter_members[] = { |
| @@ -109,7 +109,7 @@ Py_filterbank_set_triangle_bands (Py_filterbank * self, PyObject *args) · 108 unmodified lines | ||
| 109 | 109 | "error when setting filter to A-weighting"); |
| 110 | 110 | return NULL; |
| 111 | 111 | } |
| 112 | − return Py_None; | |
| 112 | + Py_RETURN_NONE; | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | static PyObject * |
| @@ -128,7 +128,7 @@ Py_filterbank_set_mel_coeffs_slaney (Py_filterbank * self, PyObject *args) · 12 unmodified lines | ||
| 128 | 128 | "error when setting filter to A-weighting"); |
| 129 | 129 | return NULL; |
| 130 | 130 | } |
| 131 | − return Py_None; | |
| 131 | + Py_RETURN_NONE; | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | static PyObject * |
| @@ -158,7 +158,7 @@ Py_filterbank_set_coeffs (Py_filterbank * self, PyObject *args) · 23 unmodified lines | ||
| 158 | 158 | "error when setting filter coefficients"); |
| 159 | 159 | return NULL; |
| 160 | 160 | } |
| 161 | − return Py_None; | |
| 161 | + Py_RETURN_NONE; | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | static PyObject * |
| @@ -342,7 +342,7 @@ def gen_do_output_params(outputparams, name): · 341 unmodified lines | ||
| 342 | 342 | else: |
| 343 | 343 | returnval += " return (PyObject *)" + aubiovectopyobj[p['type']] + " (" + p['name'] + ")" |
| 344 | 344 | else: |
| 345 | − returnval = " return Py_None;"; | |
| 345 | + returnval += " Py_RETURN_NONE" | |
| 346 | 346 | # end of output strings |
| 347 | 347 | return outputvecs, outputcreate, returnval |
| 348 | 348 | |
| @@ -473,7 +473,7 @@ Py%(funcname)s (Py_%(objname)s *self, PyObject *args) · 124 unmodified lines | ||
| 473 | 473 | "error running %(funcname)s"); |
| 474 | 474 | return NULL; |
| 475 | 475 | } |
| 476 | − return Py_None; | |
| 476 | + Py_RETURN_NONE; | |
| 477 | 477 | } |
| 478 | 478 | """ % {'funcname': method_name, 'objname': name, |
| 479 | 479 | 'out_type': out_type, 'setter_args': setter_args, 'parse_args': parse_args } |
| @@ -13,6 +13,15 @@ class aubio_sink_test_case(TestCase): · 12 unmodified lines | ||
| 13 | 13 | def setUp(self): |
| 14 | 14 | if not len(list_of_sounds): self.skipTest('add some sound files in \'python/tests/sounds\'') |
| 15 | 15 | |
| 16 | + def test_many_sinks(self): | |
| 17 | + for i in range(100): | |
| 18 | + g = sink('/tmp/f.wav', 0) | |
| 19 | + write = 256 | |
| 20 | + for n in range(200): | |
| 21 | + vec = fvec(write) | |
| 22 | + g(vec, write) | |
| 23 | + del g | |
| 24 | + | |
| 16 | 25 | def test_read(self): |
| 17 | 26 | for path in list_of_sounds: |
| 18 | 27 | for samplerate, hop_size in zip([0, 44100, 8000, 32000], [512, 1024, 64, 256]): |
| @@ -30,8 +39,8 @@ class aubio_sink_test_case(TestCase): · 11 unmodified lines | ||
| 30 | 39 | print total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")", |
| 31 | 40 | print "from", f.uri, |
| 32 | 41 | print "to", g.uri |
| 42 | + #del f, g | |
| 33 | 43 | |
| 34 | 44 | if __name__ == '__main__': |
| 35 | − from unittest import main | |
| 36 | − main() | |
| 37 | − | |
| 45 | + from unittest import main | |
| 46 | + main() | |