We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pybind11::builtin_exception
1 parent 4a236bb commit 42bc068Copy full SHA for 42bc068
tests/test_exceptions.h
@@ -4,7 +4,9 @@
4
5
// shared exceptions for cross_module_tests
6
7
-class tmp_e : public std::runtime_error {
+class PYBIND11_EXPORT tmp_e : public pybind11::builtin_exception {
8
public:
9
- explicit tmp_e() : std::runtime_error("") {}
+ using builtin_exception::builtin_exception;
10
+ explicit tmp_e() : tmp_e("") {}
11
+ void set_error() const override { PyErr_SetString(PyExc_RuntimeError, what()); }
12
};
0 commit comments