comparison pycall.cc @ 278:9278a272b1c8

Drop conversion of lists, dicts and tuples (fixes issues #27, #26) * python_to_octave.cc: Remove the logic that attempts to convert lists, dicts and tuples from python to octave cell arrays. Instead convert them to pyobjects. * pycall.cc, pyeval.cc: Do not attempt conversion to pyobject and rather issue proper error message for the exception. Change tests to consider this change.
author Abhinav Tripathi <genuinelucifer@gmail.com>
date Thu, 28 Jul 2016 13:50:54 -0700
parents 2e4c9ce0c83c
children 6e83efbcf1bc
comparison
equal deleted inserted replaced
251:c8da556b6793 278:9278a272b1c8
216 retval(0) = val; 216 retval(0) = val;
217 } 217 }
218 } 218 }
219 catch (pytave::object_convert_exception const &) 219 catch (pytave::object_convert_exception const &)
220 { 220 {
221 // Ensure we have a __InOct__ dict, and then put `res` into it 221 error ("pyexec: error in return value type conversion");
222 exec ("if not (\"__InOct__\" in vars() or \"__InOct__\" in globals()):\n"
223 " __InOct__ = dict()\n"
224 " # FIXME: make it accessible elsewhere?\n"
225 " import __main__\n"
226 " __main__.__InOct__ = __InOct__\n",
227 main_namespace, main_namespace);
228 main_namespace["__InOct__"][id] = res;
229 // Create @pyobject
230 retval = feval ("pyobject", ovl (id), 1);
231 } 222 }
232 catch (pytave::value_convert_exception const &) 223 catch (pytave::value_convert_exception const &)
233 { 224 {
234 error ("pycall: error in argument type conversion"); 225 error ("pycall: error in argument type conversion");
235 } 226 }