File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 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
224225BOOST_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 ());
You can’t perform that action at this time.
0 commit comments