2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00

boost/python/object_operators.hpp: merging trunk rev. 55708 into release branch

[SVN r55742]
This commit is contained in:
Ralf W. Grosse-Kunstleve
2009-08-23 21:22:52 +00:00
parent d685a5e8c5
commit 46be73387c

View File

@@ -60,7 +60,9 @@ inline
object_operators<U>::operator bool_type() const
{
object_cref2 x = *static_cast<U const*>(this);
return PyObject_IsTrue(x.ptr()) ? &object::ptr : 0;
int is_true = PyObject_IsTrue(x.ptr());
if (is_true < 0) throw_error_already_set();
return is_true ? &object::ptr : 0;
}
template <class U>
@@ -68,7 +70,9 @@ inline bool
object_operators<U>::operator!() const
{
object_cref2 x = *static_cast<U const*>(this);
return !PyObject_IsTrue(x.ptr());
int is_true = PyObject_IsTrue(x.ptr());
if (is_true < 0) throw_error_already_set();
return !is_true;
}
# define BOOST_PYTHON_COMPARE_OP(op, opid) \