diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-18 16:51:24 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:12:54 -0300 |
commit | 517800c3cd93c48d897ac868505e22e2e972aa22 (patch) | |
tree | 0616f68b547cba54b58f97ce33970cf0d1d499b6 /libshiboken/basewrapper.h | |
parent | 91818aecdaa52facd7f62931343f0e8aa4b69f55 (diff) |
Add Shiboken::Object::isValid(SbkObject* pyObj, bool throwPyError = true) function to libshiboken.
This function is needed to fix bug#552 when a libpyside code needs to check if a SbkObject is valid
without set a Python error when it isn't.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'libshiboken/basewrapper.h')
-rw-r--r-- | libshiboken/basewrapper.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h index bab83a08f..1abd43f48 100644 --- a/libshiboken/basewrapper.h +++ b/libshiboken/basewrapper.h @@ -253,7 +253,14 @@ LIBSHIBOKEN_API bool setCppPointer(SbkObject* sbkObj, PyTypeObject* desir /** * Returns false and sets a Python RuntimeError if the Python wrapper is not marked as valid. */ -LIBSHIBOKEN_API bool isValid(PyObject* wrapper); +LIBSHIBOKEN_API bool isValid(PyObject* pyObj); + +/** + * Returns false if the Python wrapper is not marked as valid. + * \param pyObj the object. + * \param throwPyError sets a Python RuntimeError when the object isn't valid. + */ +LIBSHIBOKEN_API bool isValid(SbkObject* pyObj, bool throwPyError = true); /** * Set the parent of \p child to \p parent. |