File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515namespace boost { namespace python {
1616
17- struct BOOST_PYTHON_DECL error_already_set {};
18- struct BOOST_PYTHON_DECL argument_error : error_already_set {};
17+ struct BOOST_PYTHON_DECL error_already_set
18+ {
19+ virtual ~error_already_set ();
20+ };
1921
2022// Handles exceptions caught just before returning to Python code.
2123// Returns true iff an exception was caught.
@@ -34,7 +36,6 @@ inline void handle_exception()
3436 handle_exception (detail::rethrow);
3537}
3638
37- BOOST_PYTHON_DECL void throw_argument_error ();
3839BOOST_PYTHON_DECL void throw_error_already_set ();
3940
4041template <class T >
Original file line number Diff line number Diff line change 1414
1515namespace boost { namespace python {
1616
17+ error_already_set::~error_already_set () {}
18+
1719// IMPORTANT: this function may only be called from within a catch block!
1820BOOST_PYTHON_DECL bool handle_exception_impl (function0<void > f)
1921{
@@ -47,30 +49,13 @@ BOOST_PYTHON_DECL bool handle_exception_impl(function0<void> f)
4749 return true ;
4850}
4951
50- void BOOST_PYTHON_DECL throw_argument_error ()
51- {
52- throw argument_error ();
53- }
54-
5552void BOOST_PYTHON_DECL throw_error_already_set ()
5653{
5754 throw error_already_set ();
5855}
5956
6057namespace detail {
6158
62- BOOST_PYTHON_DECL void expect_complex (PyObject* p)
63- {
64- if (!PyComplex_Check (p))
65- {
66- PyErr_SetString (PyExc_TypeError, " expected a complex number" );
67- boost::python::throw_argument_error ();
68- }
69- }
70-
71- // needed by void_adaptor (see void_adaptor.hpp)
72- BOOST_PYTHON_DECL PyObject arbitrary_object = { 0 };
73-
7459bool exception_handler::operator ()(function0<void > const & f) const
7560{
7661 if (m_next)
You can’t perform that action at this time.
0 commit comments