diff options
Diffstat (limited to 'src/py_amount.cc')
-rw-r--r-- | src/py_amount.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/py_amount.cc b/src/py_amount.cc index 1d9f9255..059322f1 100644 --- a/src/py_amount.cc +++ b/src/py_amount.cc @@ -1,10 +1,12 @@ #include "pyinterp.h" #include "amount.h" -using namespace boost::python; +#include <boost/python/exception_translator.hpp> namespace ledger { +using namespace boost::python; + int py_amount_quantity(amount_t& amount) { std::ostringstream quant; @@ -51,7 +53,7 @@ commodity_t * py_find_commodity(const string& symbol) PyErr_SetString(PyExc_ArithmeticError, err.what()); \ } -EXC_TRANSLATOR(amount_exception) +EXC_TRANSLATOR(amount_error) void export_amount() { @@ -236,10 +238,10 @@ void export_amount() #endif ; -#define EXC_TRANSLATE(type) \ +#define EXC_TRANSLATE(type) \ register_exception_translator<type>(&exc_translate_ ## type); - EXC_TRANSLATE(amount_exception); + EXC_TRANSLATE(amount_error); } } // namespace ledger |