{
uint_t err = 0;
- uint_t position;
+ int position;
if (!PyArg_ParseTuple (args, "I", &position)) {
return NULL;
}
+ if (position < 0) {
+ PyErr_Format(PyExc_ValueError,
+ "error when seeking in source: can not seek to negative value %d",
+ position);
+ return NULL;
+ }
+
err = aubio_source_seek(self->o, position);
if (err != 0) {
PyErr_SetString (PyExc_ValueError,