Kaydet (Commit) cbfc855f authored tarafından Guido van Rossum's avatar Guido van Rossum

The "O!" format code should implement an isinstance() test

rather than a type equality test.
üst 63db7b9c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment