diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-08-28 21:55:35 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-08-28 21:55:35 (GMT) |
commit | 23d49d3e7e386bb2b26d5b944fc123f0f21ce0a6 (patch) | |
tree | 2505d06c40de0283e39a5628108f72bf0549b7ff /Objects | |
parent | 25cf30faf92b8b77c69a0fd4b839ceefbbaccc4f (diff) | |
download | cpython-23d49d3e7e386bb2b26d5b944fc123f0f21ce0a6.zip cpython-23d49d3e7e386bb2b26d5b944fc123f0f21ce0a6.tar.gz cpython-23d49d3e7e386bb2b26d5b944fc123f0f21ce0a6.tar.bz2 |
use the stricter PyMapping_Check (closes #15801)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringobject.c | 2 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index fd2f630..7c4a86b 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -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) { diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 59b138a..d40f2e4 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8275,7 +8275,7 @@ PyObject *PyUnicode_Format(PyObject *format, 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; |