use the stricter PyMapping_Check (closes #15801)

This commit is contained in:
Benjamin Peterson 2012-08-28 17:55:35 -04:00
parent 25cf30faf9
commit 23d49d3e7e
4 changed files with 8 additions and 2 deletions

View file

@ -4254,7 +4254,7 @@ PyString_Format(PyObject *format, PyObject *args)
arglen = -1;
argidx = -2;
}
if (Py_TYPE(args)->tp_as_mapping && !PyTuple_Check(args) &&
if (PyMapping_Check(args) && !PyTuple_Check(args) &&
!PyObject_TypeCheck(args, &PyBaseString_Type))
dict = args;
while (--fmtcnt >= 0) {