comparison oct-py-types.cc @ 423:6b9de18b4bdd

Eliminate remaining custom exception handling in favor of Octave errors * oct-py-error.cc, oct-py-error.h (pytave::error_python_exception): New function to generate an Octave error from an active Python error condition, based on pytave::fetch_exception_message. * oct-py-eval.cc (pytave::py_call_function, pytave::py_run_string_safe): Use it. * oct-py-types.cc (pytave::make_py_dict): Likewise. * oct-py-util.cc (pytave::py_objstore): Likewise. * pycall.cc (Fpycall): Remove exception handling logic. * pyeval.cc (Fpyeval): Likewise. * pyexec.cc (Fpyexec): Likewise. * exceptions.cc, exceptions.h: Delete. * Makefile.am (COMMON_SOURCE_FILES, PYTAVE_HEADER_FILES): Remove them.
author Mike Miller <mtmiller@octave.org>
date Thu, 04 May 2017 21:15:07 -0700
parents 8247f298fd16
children
comparison
equal deleted inserted replaced
422:8247f298fd16 423:6b9de18b4bdd
29 #include <octave/Cell.h> 29 #include <octave/Cell.h>
30 #include <octave/oct-map.h> 30 #include <octave/oct-map.h>
31 #include <octave/quit.h> 31 #include <octave/quit.h>
32 #include <octave/ov-null-mat.h> 32 #include <octave/ov-null-mat.h>
33 33
34 #include "exceptions.h"
35 #include "oct-py-error.h" 34 #include "oct-py-error.h"
36 #include "oct-py-eval.h" 35 #include "oct-py-eval.h"
37 #include "oct-py-object.h" 36 #include "oct-py-object.h"
38 #include "oct-py-types.h" 37 #include "oct-py-types.h"
39 #include "oct-py-util.h" 38 #include "oct-py-util.h"
359 octave_throw_bad_alloc (); 358 octave_throw_bad_alloc ();
360 359
361 PyObject *item = py_implicitly_convert_argument (map.contents (p)); 360 PyObject *item = py_implicitly_convert_argument (map.contents (p));
362 361
363 if (PyDict_SetItem (dict, key, item) < 0) 362 if (PyDict_SetItem (dict, key, item) < 0)
364 throw pytave::error_already_set (); 363 error_python_exception ();
365 } 364 }
366 365
367 return dict; 366 return dict;
368 } 367 }
369 368