diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-30 11:22:08 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:34 -0400 |
commit | 21af83013f3b1bae511a61b9e27224ab3de235c1 (patch) | |
tree | bf0eea45f33e7e269220adc6ce37815f7bc14a3f /src/py_amount.cc | |
parent | 3ba6c2572dfc58bcd963cbc8cac1cce2f5b01dba (diff) | |
download | fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.tar.gz fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.tar.bz2 fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.zip |
Did more work on the utility code.
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 |