diff oct-py-eval.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
line wrap: on
line diff
--- a/oct-py-eval.cc	Thu May 04 17:13:38 2017 -0700
+++ b/oct-py-eval.cc	Thu May 04 21:15:07 2017 -0700
@@ -29,7 +29,7 @@
 #include <octave/ov.h>
 #include <octave/ovl.h>
 
-#include "exceptions.h"
+#include "oct-py-error.h"
 #include "oct-py-eval.h"
 #include "oct-py-object.h"
 #include "oct-py-util.h"
@@ -84,7 +84,7 @@
   {
     python_object retval = PyEval_CallObjectWithKeywords (callable, args, kwargs);
     if (! retval)
-      throw pytave::error_already_set ();
+      error_python_exception ();
 
     return retval.release ();
   }
@@ -119,7 +119,7 @@
       Py_DECREF (globals);
 
     if (! retval)
-      throw pytave::error_already_set ();
+      error_python_exception ();
 
     return retval.release ();
   }