Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55742 - in branches/release: boost/python libs/python
From: rwgk_at_[hidden]
Date: 2009-08-23 17:22:52


Author: rwgk
Date: 2009-08-23 17:22:52 EDT (Sun, 23 Aug 2009)
New Revision: 55742
URL: http://svn.boost.org/trac/boost/changeset/55742

Log:
boost/python/object_operators.hpp: merging trunk rev. 55708 into release branch
Properties modified:
   branches/release/boost/python/ (props changed)
   branches/release/libs/python/ (props changed)
Text files modified:
   branches/release/boost/python/object_operators.hpp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: branches/release/boost/python/object_operators.hpp
==============================================================================
--- branches/release/boost/python/object_operators.hpp (original)
+++ branches/release/boost/python/object_operators.hpp 2009-08-23 17:22:52 EDT (Sun, 23 Aug 2009)
@@ -60,7 +60,9 @@
 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 @@
 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) \


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk