diff Python/getargs.c @ 19533:3e7897822459 legacy-trunk

The "O!" format code should implement an isinstance() test rather than a type equality test.
author Guido van Rossum <guido@python.org>
date Tue, 28 Aug 2001 16:37:51 +0000
parents 7257e87e0720
children fe5ec1a3a7e0
line wrap: on
line diff
--- a/Python/getargs.c	Tue Aug 28 16:36:12 2001 +0000
+++ b/Python/getargs.c	Tue Aug 28 16:37:51 2001 +0000
@@ -875,7 +875,7 @@
 			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);