summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-28 16:37:51 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-28 16:37:51 (GMT)
commitcbfc855f57ab6ad7920857bba3a8e2475ef0fb33 (patch)
tree033be7a0a2b8e08608af914926c56061878fdbf2 /Python
parent63db7b9ca13cf319aeef9bab4aa107502d3f5907 (diff)
downloadcpython-cbfc855f57ab6ad7920857bba3a8e2475ef0fb33.zip
cpython-cbfc855f57ab6ad7920857bba3a8e2475ef0fb33.tar.gz
cpython-cbfc855f57ab6ad7920857bba3a8e2475ef0fb33.tar.bz2
The "O!" format code should implement an isinstance() test
rather than a type equality test.
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 9f76ac0..a4dc57a 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -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);