Skip to content

Commit 1d2dc98

Browse files
committed
MSVC6 workaround
[SVN r14485]
1 parent 7a05b89 commit 1d2dc98

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/converter/from_python.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <boost/python/converter/rvalue_from_python_data.hpp>
1010
#include <boost/python/handle.hpp>
1111
#include <boost/python/detail/raw_pyobject.hpp>
12+
#include <boost/python/cast.hpp>
1213
#include <vector>
1314
#include <algorithm>
1415

@@ -222,15 +223,15 @@ BOOST_PYTHON_DECL void void_result_from_python(PyObject* o)
222223
}
223224

224225
BOOST_PYTHON_DECL python::detail::new_reference
225-
pytype_result_from_python(PyTypeObject* type, PyObject* source)
226+
pytype_result_from_python(PyTypeObject* type_, PyObject* source)
226227
{
227-
if (!PyType_IsSubtype(source->ob_type, type))
228+
if (!PyObject_IsInstance(source, python::upcast<PyObject>(type_)))
228229
{
229230
handle<> keeper(source);
230231
handle<> msg(
231232
::PyString_FromFormat(
232233
"Expecting a Python %s return type, but got an object of type %s instead"
233-
, type
234+
, type_
234235
, source->ob_type->tp_name
235236
));
236237
PyErr_SetObject(PyExc_TypeError, msg.get());

0 commit comments

Comments
 (0)