diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-07-05 18:32:41 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-07-06 10:45:49 -0300 |
commit | d83a157f2b973c245c772d9ec27403f8f33cf73d (patch) | |
tree | 638dbe460b4a5563dc91fb1a44d462ce666981a2 | |
parent | 8a6790433c874ff6882c7c191582b66e092ae6c5 (diff) |
Fix Converter<bool>::toCpp, to correctly convert number to boolean values.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r-- | libshiboken/conversions.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<bool> static inline bool isConvertible(PyObject* pyobj) { return PyInt_Check(pyobj); } static inline PyObject* toPython(void* cppobj) { return toPython(*reinterpret_cast<bool*>(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); } }; /** |