Commit 6b74621a authored by Guido van Rossum's avatar Guido van Rossum

Need a cast when comparing type object in isinstance()

parent e66dc3e7
...@@ -1628,7 +1628,7 @@ builtin_isinstance(self, args) ...@@ -1628,7 +1628,7 @@ builtin_isinstance(self, args)
if (!PyArg_ParseTuple(args, "OO", &inst, &cls)) if (!PyArg_ParseTuple(args, "OO", &inst, &cls))
return NULL; return NULL;
if (PyType_Check(cls)) { if (PyType_Check(cls)) {
retval = (inst->ob_type == cls); retval = ((PyObject *)(inst->ob_type) == cls);
} }
else { else {
if (!PyClass_Check(cls)) { if (!PyClass_Check(cls)) {
......
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