mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119)
This commit is contained in:
parent
4bfebc6301
commit
1d1d3e9db8
8 changed files with 67 additions and 19 deletions
|
@ -562,8 +562,15 @@ _io_IncrementalNewlineDecoder_setstate(nldecoder_object *self,
|
|||
PyObject *buffer;
|
||||
unsigned long long flag;
|
||||
|
||||
if (!PyArg_ParseTuple(state, "OK", &buffer, &flag))
|
||||
if (!PyTuple_Check(state)) {
|
||||
PyErr_SetString(PyExc_TypeError, "state argument must be a tuple");
|
||||
return NULL;
|
||||
}
|
||||
if (!PyArg_ParseTuple(state, "OK;setstate(): illegal state argument",
|
||||
&buffer, &flag))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
self->pendingcr = (int) (flag & 1);
|
||||
flag >>= 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue