mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
audioop: adpcm2lin() and lin2adpcm() now raises a TypeError instead of a
SystemError if the state type is invalid.
This commit is contained in:
parent
6f055e73df
commit
daeffd2c08
2 changed files with 11 additions and 0 deletions
|
@ -1525,6 +1525,9 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
|
|||
/* First time, it seems. Set defaults */
|
||||
valpred = 0;
|
||||
index = 0;
|
||||
} else if (!PyTuple_Check(state)) {
|
||||
PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
|
||||
goto exit;
|
||||
} else if (!PyArg_ParseTuple(state, "ii", &valpred, &index))
|
||||
goto exit;
|
||||
|
||||
|
@ -1631,6 +1634,9 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
|
|||
/* First time, it seems. Set defaults */
|
||||
valpred = 0;
|
||||
index = 0;
|
||||
} else if (!PyTuple_Check(state)) {
|
||||
PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
|
||||
goto exit;
|
||||
} else if (!PyArg_ParseTuple(state, "ii", &valpred, &index))
|
||||
goto exit;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue