mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
handle dict subclasses gracefully in PyArg_ValidateKeywordArguments
This commit is contained in:
parent
12ae290bf3
commit
f609654b0e
4 changed files with 14 additions and 6 deletions
|
|
@ -454,7 +454,7 @@ _PyDict_HasOnlyStringKeys(PyObject *dict)
|
|||
{
|
||||
Py_ssize_t pos = 0;
|
||||
PyObject *key, *value;
|
||||
assert(PyDict_CheckExact(dict));
|
||||
assert(PyDict_Check(dict));
|
||||
/* Shortcut */
|
||||
if (((PyDictObject *)dict)->ma_lookup == lookdict_unicode)
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue