Skip to content

Commit

Permalink
use pybind11::builtin_exception
Browse files Browse the repository at this point in the history
  • Loading branch information
oraluben committed May 23, 2021
1 parent 4a236bb commit 42bc068
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

// shared exceptions for cross_module_tests

class tmp_e : public std::runtime_error {
class PYBIND11_EXPORT tmp_e : public pybind11::builtin_exception {
public:
explicit tmp_e() : std::runtime_error("") {}
using builtin_exception::builtin_exception;
explicit tmp_e() : tmp_e("") {}
void set_error() const override { PyErr_SetString(PyExc_RuntimeError, what()); }
};

0 comments on commit 42bc068

Please sign in to comment.