File tree Expand file tree Collapse file tree 4 files changed +0
-44
lines changed Expand file tree Collapse file tree 4 files changed +0
-44
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,6 @@ namespace rpygen {
14
14
struct EmptyTrampolineCfg {};
15
15
};
16
16
17
- // robotpy-build specific extensions waiting for inclusion into pybind11
18
- namespace rpybuild_ext {
19
- using py::raise_from;
20
- } // namespace rpybuild_ext
21
-
22
17
#define RPYBUILD_BAD_TRAMPOLINE \
23
18
" has an abstract trampoline -- and they must never be abstract! One of " \
24
19
" the generated override methods doesn't match the original class or its " \
Original file line number Diff line number Diff line change 114
114
fnSimpleDefaultParam ,
115
115
get123 ,
116
116
important_retval ,
117
- raise_from ,
118
- raise_from_already_set ,
119
117
subpkg ,
120
118
)
121
119
232
230
"fnSimpleDefaultParam" ,
233
231
"get123" ,
234
232
"important_retval" ,
235
- "raise_from" ,
236
- "raise_from_already_set" ,
237
233
"subpkg" ,
238
234
]
239
235
Original file line number Diff line number Diff line change 4
4
RPYBUILD_PYBIND11_MODULE (m)
5
5
{
6
6
initWrapper (m);
7
-
8
- m.def (" raise_from" , []() {
9
- PyErr_SetString (PyExc_ValueError, " inner" );
10
- rpybuild_ext::raise_from (PyExc_ValueError, " outer" );
11
- throw py::error_already_set ();
12
- });
13
-
14
- m.def (" raise_from_already_set" , []() {
15
- try {
16
- PyErr_SetString (PyExc_ValueError, " inner" );
17
- throw py::error_already_set ();
18
- } catch (py::error_already_set& e) {
19
- rpybuild_ext::raise_from (e, PyExc_ValueError, " outer" );
20
- throw py::error_already_set ();
21
- }
22
- });
23
7
}
Original file line number Diff line number Diff line change 2
2
import pytest
3
3
import re
4
4
5
- #
6
- # main module
7
- #
8
-
9
-
10
- def test_raise_from ():
11
- with pytest .raises (ValueError ) as excinfo :
12
- ft .raise_from ()
13
- assert str (excinfo .value ) == "outer"
14
- assert str (excinfo .value .__cause__ ) == "inner"
15
-
16
-
17
- def test_raise_from_already_set ():
18
- with pytest .raises (ValueError ) as excinfo :
19
- ft .raise_from_already_set ()
20
- assert str (excinfo .value ) == "outer"
21
- assert str (excinfo .value .__cause__ ) == "inner"
22
-
23
-
24
5
#
25
6
# abstract.h
26
7
#
You can’t perform that action at this time.
0 commit comments