Kaydet (Commit) 4facdf52 authored tarafından Oren Milman's avatar Oren Milman Kaydeden (comit) Serhiy Storchaka

bpo-31311: Impove error reporting in case the first argument to…

bpo-31311: Impove error reporting in case the first argument to PyCData_setstate() isn't a dictionary. (#3255)
üst 2b382dd6
......@@ -2665,8 +2665,11 @@ PyCData_setstate(PyObject *myself, PyObject *args)
int res;
PyObject *dict, *mydict;
CDataObject *self = (CDataObject *)myself;
if (!PyArg_ParseTuple(args, "Os#", &dict, &data, &len))
if (!PyArg_ParseTuple(args, "O!s#",
&PyDict_Type, &dict, &data, &len))
{
return NULL;
}
if (len > self->b_size)
len = self->b_size;
memmove(self->b_ptr, data, len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment