summaryrefslogtreecommitdiffstats
path: root/libshiboken/conversions.h
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-07-05 18:32:41 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-07-06 10:45:49 -0300
commitd83a157f2b973c245c772d9ec27403f8f33cf73d (patch)
tree638dbe460b4a5563dc91fb1a44d462ce666981a2 /libshiboken/conversions.h
parent8a6790433c874ff6882c7c191582b66e092ae6c5 (diff)
downloadshiboken-d83a157f2b973c245c772d9ec27403f8f33cf73d.tar.gz
shiboken-d83a157f2b973c245c772d9ec27403f8f33cf73d.tar.xz
shiboken-d83a157f2b973c245c772d9ec27403f8f33cf73d.zip
Fix Converter<bool>::toCpp, to correctly convert number to boolean values.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libshiboken/conversions.h')
-rw-r--r--libshiboken/conversions.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index c3e3c4fa..38a90f5c 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); }
};
/**