mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
The "O!" format code should implement an isinstance() test
rather than a type equality test.
This commit is contained in:
parent
63db7b9ca1
commit
cbfc855f57
1 changed files with 1 additions and 1 deletions
|
@ -875,7 +875,7 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf)
|
|||
type = va_arg(*p_va, PyTypeObject*);
|
||||
p = va_arg(*p_va, PyObject **);
|
||||
format++;
|
||||
if (arg->ob_type == type)
|
||||
if (PyType_IsSubtype(arg->ob_type, type))
|
||||
*p = arg;
|
||||
else
|
||||
return converterr(type->tp_name, arg, msgbuf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue