diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-01 17:45:25 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-01 17:45:25 -0600 |
commit | 72b1a948def6c7a2e969d18faef9c2260ccf57e6 (patch) | |
tree | 6ab5148dd4765b8f7d3052ec668d000f2988cfbf /src/pyinterp.cc | |
parent | f6c087cfe48e6410db61a9367ce7c718a490af77 (diff) | |
download | fork-ledger-72b1a948def6c7a2e969d18faef9c2260ccf57e6.tar.gz fork-ledger-72b1a948def6c7a2e969d18faef9c2260ccf57e6.tar.bz2 fork-ledger-72b1a948def6c7a2e969d18faef9c2260ccf57e6.zip |
Fixes to value_t to Python conversion
Diffstat (limited to 'src/pyinterp.cc')
-rw-r--r-- | src/pyinterp.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pyinterp.cc b/src/pyinterp.cc index dc6fb4f7..048f5a39 100644 --- a/src/pyinterp.cc +++ b/src/pyinterp.cc @@ -467,7 +467,7 @@ namespace { case value_t::STRING: // a string object return object(handle<>(borrowed(str_to_py_unicode(val.as_string())))); case value_t::MASK: // a regular expression mask - return object(handle<>(borrowed(str_to_py_unicode(val.as_mask().str())))); + return object(val); case value_t::SEQUENCE: { // a vector of value_t objects list arglist; foreach (const value_t& elem, val.as_sequence()) @@ -495,8 +495,7 @@ namespace { } return object(); case value_t::ANY: // a pointer to an arbitrary object - assert("Attempted to convert an Value.ANY object to Python" == NULL); - return object(); + return object(val); } } } @@ -535,8 +534,7 @@ value_t python_interpreter_t::functor_t::operator()(call_scope_t& args) Py_DECREF(val); } else { Py_DECREF(val); - throw_(calc_error, - _("Could not evaluate Python variable '%1'") << name); + return NULL_VALUE; } std::signal(SIGINT, sigint_handler); return result; |