summaryrefslogtreecommitdiff
path: root/python/pyinterp.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-07 02:53:10 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-07 02:53:35 -0400
commit0eda1ad2c6db874a6fed9c45851d4222250a2255 (patch)
treeb9e784574e417bd2f5d52b0c3895589d012149f7 /python/pyinterp.cc
parent6ddc21dc5fe75c80df1bf383e5bfc2320deb8624 (diff)
downloadledger-0eda1ad2c6db874a6fed9c45851d4222250a2255.tar.gz
ledger-0eda1ad2c6db874a6fed9c45851d4222250a2255.tar.bz2
ledger-0eda1ad2c6db874a6fed9c45851d4222250a2255.zip
The Python interface layer is building again.
Diffstat (limited to 'python/pyinterp.cc')
-rw-r--r--python/pyinterp.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/python/pyinterp.cc b/python/pyinterp.cc
index 07a619fe..831852ad 100644
--- a/python/pyinterp.cc
+++ b/python/pyinterp.cc
@@ -177,8 +177,7 @@ object python_interpreter_t::eval(const string& str, py_eval_mode_t mode)
return object();
}
-value_t python_interpreter_t::functor_t::operator()
- (expr_t::call_scope_t& args)
+value_t python_interpreter_t::functor_t::operator()(call_scope_t& args)
{
try {
if (! PyCallable_Check(func.ptr())) {
@@ -201,7 +200,7 @@ value_t python_interpreter_t::functor_t::operator()
}
else if (PyObject * err = PyErr_Occurred()) {
PyErr_Print();
- throw_(expr_t::calc_error,
+ throw_(calc_error,
"While calling Python function '" /*<< name() <<*/ "': " << err);
} else {
assert(false);
@@ -213,25 +212,22 @@ value_t python_interpreter_t::functor_t::operator()
}
catch (const error_already_set&) {
PyErr_Print();
- throw_(expr_t::calc_error,
+ throw_(calc_error,
"While calling Python function '" /*<< name() <<*/ "'");
}
return NULL_VALUE;
}
-value_t python_interpreter_t::lambda_t::operator()
- (expr_t::call_scope_t& args)
+value_t python_interpreter_t::lambda_t::operator()(call_scope_t& args)
{
try {
assert(args.size() == 1);
value_t item = args[0];
- assert(item.is_xml_node());
- return call<value_t>(func.ptr(), item.as_xml_node());
+ return call<value_t>(func.ptr(), item);
}
catch (const error_already_set&) {
PyErr_Print();
- throw_(expr_t::calc_error,
- "While evaluating Python lambda expression");
+ throw_(calc_error, "While evaluating Python lambda expression");
}
return NULL_VALUE;
}