summaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-03-22 17:00:31 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-03-22 17:00:31 -0300
commit2d01f9d633e74718669bc40e9789ed513dfc8b59 (patch)
treea1ba4982644e1c07c85b83cd75ebdb6cf2c09044 /libshiboken
parentc8ee3423948143cf1123586e6a95ebaa5578dc14 (diff)
downloadshiboken-2d01f9d633e74718669bc40e9789ed513dfc8b59.tar.gz
shiboken-2d01f9d633e74718669bc40e9789ed513dfc8b59.tar.xz
shiboken-2d01f9d633e74718669bc40e9789ed513dfc8b59.zip
Converter<T*>::toCpp specialization now converts None to NULL pointer first.
With the recent changes to Converter's behaviour, in particular to isConvertible method, Converter<T*>::toCpp must deal with Py_None values first.
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/conversions.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index 13e711d8..541e026b 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -150,7 +150,9 @@ struct Converter<T*>
static T* toCpp(PyObject* pyobj)
{
- if (Shiboken_TypeCheck(pyobj, T))
+ if (pyobj == Py_None)
+ return 0;
+ else if (Shiboken_TypeCheck(pyobj, T))
return (T*) SbkBaseWrapper_cptr(pyobj);
else if (Converter<T>::isConvertible(pyobj))
return CppObjectCopier<T>::copy(Converter<T>::toCpp(pyobj));