diff options
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index eca8677..d3603f0 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -973,15 +973,16 @@ dict_fromkeys(PyObject *mp, PyObject *args) PyObject *cls; int status; - if (!PyArg_ParseTuple(args, "OO|O:fromkeys", &cls, &seq, &value)) + if (!PyArg_ParseTuple(args, "OO|O:fromkeys", &cls, &seq, &value)) return NULL; d = PyObject_CallObject(cls, NULL); if (d == NULL) return NULL; if (!PyDict_Check(d)) { - PyErr_BadInternalCall(); Py_DECREF(d); + PyErr_SetString(PyExc_TypeError, + "class constructor must return a subclass of dict"); return NULL; } |