diff options
| author | John Wiegley <johnw@newartisans.com> | 2007-05-07 10:25:29 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:39 -0400 |
| commit | 426a01b3f4163dcb5f0ca4bff6dbdcb3333616c4 (patch) | |
| tree | 9e4456bae0efaef43bfa1aa55c178cb99796ea20 /src/pyutils.h | |
| parent | c211335760f2c5883aed34c31aeb6ce7e8e51bf9 (diff) | |
| download | ledger-426a01b3f4163dcb5f0ca4bff6dbdcb3333616c4.tar.gz ledger-426a01b3f4163dcb5f0ca4bff6dbdcb3333616c4.tar.bz2 ledger-426a01b3f4163dcb5f0ca4bff6dbdcb3333616c4.zip | |
Added by-value conversions to Python for bool. This allowed me to
expose all of the amount_t members now.
Diffstat (limited to 'src/pyutils.h')
| -rw-r--r-- | src/pyutils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pyutils.h b/src/pyutils.h index 42d5f1e0..51ca8734 100644 --- a/src/pyutils.h +++ b/src/pyutils.h @@ -27,8 +27,9 @@ struct register_optional_to_python : public boost::noncopyable { static PyObject * convert(const boost::optional<T>& value) { - return (value ? boost::python::to_python_value<T>()(*value) : - boost::python::detail::none()); + return boost::python::incref + (value ? boost::python::to_python_value<T>()(*value) : + boost::python::detail::none()); } }; |
