Commit 76a64ca4 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #24683: Fixed a crash in _json.make_encoder() called with non-dict 1st argument.

parent cf74c199
......@@ -1850,6 +1850,13 @@ encoder_init(PyObject *self, PyObject *args, PyObject *kwds)
if (allow_nan < 0)
return -1;
if (markers != Py_None && !PyDict_Check(markers)) {
PyErr_Format(PyExc_TypeError,
"make_encoder() argument 1 must be dict or None, "
"not %.200s", Py_TYPE(markers)->tp_name);
return -1;
}
s->markers = markers;
s->defaultfn = defaultfn;
s->encoder = encoder;
......
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