2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 05:42:30 +00:00

Attempt to work around a GCC EH problem by sticking a virtual function

in error_already_set and defining it in the library.

Removed some flotsam


[SVN r19274]
This commit is contained in:
Dave Abrahams
2003-07-23 03:00:48 +00:00
parent af53ae8329
commit 77f5eb703c
2 changed files with 6 additions and 20 deletions

View File

@@ -14,8 +14,10 @@
namespace boost { namespace python {
struct BOOST_PYTHON_DECL error_already_set {};
struct BOOST_PYTHON_DECL argument_error : error_already_set {};
struct BOOST_PYTHON_DECL error_already_set
{
virtual ~error_already_set();
};
// Handles exceptions caught just before returning to Python code.
// Returns true iff an exception was caught.
@@ -34,7 +36,6 @@ inline void handle_exception()
handle_exception(detail::rethrow);
}
BOOST_PYTHON_DECL void throw_argument_error();
BOOST_PYTHON_DECL void throw_error_already_set();
template <class T>

View File

@@ -14,6 +14,8 @@
namespace boost { namespace python {
error_already_set::~error_already_set() {}
// IMPORTANT: this function may only be called from within a catch block!
BOOST_PYTHON_DECL bool handle_exception_impl(function0<void> f)
{
@@ -47,11 +49,6 @@ BOOST_PYTHON_DECL bool handle_exception_impl(function0<void> f)
return true;
}
void BOOST_PYTHON_DECL throw_argument_error()
{
throw argument_error();
}
void BOOST_PYTHON_DECL throw_error_already_set()
{
throw error_already_set();
@@ -59,18 +56,6 @@ void BOOST_PYTHON_DECL throw_error_already_set()
namespace detail {
BOOST_PYTHON_DECL void expect_complex(PyObject* p)
{
if (!PyComplex_Check(p))
{
PyErr_SetString(PyExc_TypeError, "expected a complex number");
boost::python::throw_argument_error();
}
}
// needed by void_adaptor (see void_adaptor.hpp)
BOOST_PYTHON_DECL PyObject arbitrary_object = { 0 };
bool exception_handler::operator()(function0<void> const& f) const
{
if (m_next)