Mercurial > pytave
comparison oct-py-util.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 | 24555fba9964 |
children |
comparison
equal
deleted
inserted
replaced
422:8247f298fd16 | 423:6b9de18b4bdd |
---|---|
26 | 26 |
27 #include <Python.h> | 27 #include <Python.h> |
28 #include <octave/oct.h> | 28 #include <octave/oct.h> |
29 #include <octave/parse.h> | 29 #include <octave/parse.h> |
30 | 30 |
31 #include "exceptions.h" | 31 #include "oct-py-error.h" |
32 #include "oct-py-object.h" | 32 #include "oct-py-object.h" |
33 #include "oct-py-types.h" | 33 #include "oct-py-types.h" |
34 #include "oct-py-util.h" | 34 #include "oct-py-util.h" |
35 | 35 |
36 namespace pytave | 36 namespace pytave |
170 if (dict && ns) | 170 if (dict && ns) |
171 PyDict_SetItemString (ns, "_in_octave", dict); | 171 PyDict_SetItemString (ns, "_in_octave", dict); |
172 } | 172 } |
173 | 173 |
174 if (! dict) | 174 if (! dict) |
175 throw pytave::error_already_set (); | 175 error_python_exception (); |
176 | 176 |
177 objstore = dict; | 177 objstore = dict; |
178 } | 178 } |
179 return objstore; | 179 return objstore; |
180 } | 180 } |