From 1d2dc98f50e69c124d89499642520cf5251b47ca Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 16 Jul 2002 20:01:38 +0000 Subject: [PATCH] MSVC6 workaround [SVN r14485] --- src/converter/from_python.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/converter/from_python.cpp b/src/converter/from_python.cpp index 953bf946..30c31f4f 100644 --- a/src/converter/from_python.cpp +++ b/src/converter/from_python.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -222,15 +223,15 @@ BOOST_PYTHON_DECL void void_result_from_python(PyObject* o) } BOOST_PYTHON_DECL python::detail::new_reference -pytype_result_from_python(PyTypeObject* type, PyObject* source) +pytype_result_from_python(PyTypeObject* type_, PyObject* source) { - if (!PyType_IsSubtype(source->ob_type, type)) + if (!PyObject_IsInstance(source, python::upcast(type_))) { handle<> keeper(source); handle<> msg( ::PyString_FromFormat( "Expecting a Python %s return type, but got an object of type %s instead" - , type + , type_ , source->ob_type->tp_name )); PyErr_SetObject(PyExc_TypeError, msg.get());