Mercurial > pytave
diff exceptions.h @ 392:09a1acb81d8b
Delete legacy code no longer used in project
* configure.ac: Drop checks for headers and functions no longer needed.
* exceptions.cc, exceptions.h: Delete pytave::init_exceptions and related
methods and properties for registering exceptions with Boost.Python runtime.
* octave_to_python.cc, octave_to_python.h (pytave::octlist_to_pytuple): Delete.
* python_to_octave.cc, python_to_octave.h (pytave::pytuple_to_octlist): Delete.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Mon, 03 Apr 2017 13:31:00 -0700 |
parents | 6fffa6219b2c |
children | 9bf8ba050122 |
line wrap: on
line diff
--- a/exceptions.h Mon Apr 03 12:25:03 2017 -0700 +++ b/exceptions.h Mon Apr 03 13:31:00 2017 -0700 @@ -32,11 +32,6 @@ class pytave_exception { public: - static void translate_exception (const pytave_exception& py_ex) - { - PyErr_SetString (PyExc_Exception, py_ex.error.c_str ()); - } - pytave_exception (const std::string& err) { error = err; }; private: @@ -46,20 +41,6 @@ class octave_error_exception { public: - static bool init () - { - excclass = PyErr_NewException (const_cast<char*> ("pytave.OctaveError"), - PyExc_RuntimeError, 0); - return (excclass != 0); - }; - - static void translate_exception (const octave_error_exception& py_ex) - { - PyErr_SetString (excclass, py_ex.error.c_str ()); - } - - static PyObject *excclass; - octave_error_exception (const std::string& err) { error = err; }; private: @@ -69,20 +50,6 @@ class octave_parse_exception { public: - static bool init () - { - excclass = PyErr_NewException (const_cast<char*> ("pytave.ParseError"), - PyExc_RuntimeError, 0); - return (excclass != 0); - }; - - static void translate_exception (const octave_parse_exception& py_ex) - { - PyErr_SetString (excclass, py_ex.error.c_str ()); - } - - static PyObject *excclass; - octave_parse_exception (const std::string& err) { error = err; }; private: @@ -92,20 +59,6 @@ class value_convert_exception { public: - static bool init () - { - excclass = PyErr_NewException (const_cast<char*> ("pytave.ValueConvertError"), - PyExc_TypeError, 0); - return (excclass != 0); - }; - - static void translate_exception (const value_convert_exception& py_ex) - { - PyErr_SetString (excclass, py_ex.error.c_str ()); - } - - static PyObject *excclass; - value_convert_exception (const std::string& err) { error = err; }; private: @@ -115,20 +68,6 @@ class object_convert_exception { public: - static bool init () - { - excclass = PyErr_NewException (const_cast<char*> ("pytave.ObjectConvertError"), - PyExc_TypeError, 0); - return (excclass != 0); - }; - - static void translate_exception (const object_convert_exception& py_ex) - { - PyErr_SetString (excclass, py_ex.error.c_str ()); - } - - static PyObject *excclass; - object_convert_exception (const std::string& err) { error = err; }; private: @@ -138,27 +77,12 @@ class variable_name_exception { public: - static bool init () - { - excclass = PyErr_NewException (const_cast<char*> ("pytave.VarNameError"), - PyExc_RuntimeError, 0); - return (excclass != 0); - }; - - static void translate_exception (const variable_name_exception& py_ex) - { - PyErr_SetString (excclass, py_ex.error.c_str ()); - } - - static PyObject *excclass; - variable_name_exception (const std::string& err) { error = err; }; private: std::string error; }; - bool init_exceptions (void); std::string fetch_exception_message (void); }