From d83a157f2b973c245c772d9ec27403f8f33cf73d Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 5 Jul 2010 18:32:41 -0300 Subject: Fix Converter::toCpp, to correctly convert number to boolean values. Reviewer: Luciano Wolf Marcelo Lira --- libshiboken/conversions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h index c3e3c4fab..38a90f5c2 100644 --- a/libshiboken/conversions.h +++ b/libshiboken/conversions.h @@ -316,7 +316,7 @@ struct Converter static inline bool isConvertible(PyObject* pyobj) { return PyInt_Check(pyobj); } static inline PyObject* toPython(void* cppobj) { return toPython(*reinterpret_cast(cppobj)); } static inline PyObject* toPython(bool cppobj) { return PyBool_FromLong(cppobj); } - static inline bool toCpp(PyObject* pyobj) { return pyobj == Py_True; } + static inline bool toCpp(PyObject* pyobj) { return PyInt_AS_LONG(pyobj); } }; /** -- cgit v1.2.3