Skip to content

Commit 3c29651

Browse files
authored
Merge pull request #257 from robotpy/rm-raise-from
Remove rpybuild_ext::raise_from
2 parents 99b038f + f4e4308 commit 3c29651

File tree

4 files changed

+0
-44
lines changed

4 files changed

+0
-44
lines changed

robotpy_build/include/robotpy_build.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ namespace rpygen {
1414
struct EmptyTrampolineCfg {};
1515
};
1616

17-
// robotpy-build specific extensions waiting for inclusion into pybind11
18-
namespace rpybuild_ext {
19-
using py::raise_from;
20-
} // namespace rpybuild_ext
21-
2217
#define RPYBUILD_BAD_TRAMPOLINE \
2318
"has an abstract trampoline -- and they must never be abstract! One of " \
2419
"the generated override methods doesn't match the original class or its " \

tests/cpp/rpytest/ft/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@
114114
fnSimpleDefaultParam,
115115
get123,
116116
important_retval,
117-
raise_from,
118-
raise_from_already_set,
119117
subpkg,
120118
)
121119

@@ -232,8 +230,6 @@
232230
"fnSimpleDefaultParam",
233231
"get123",
234232
"important_retval",
235-
"raise_from",
236-
"raise_from_already_set",
237233
"subpkg",
238234
]
239235

tests/cpp/rpytest/ft/src/ft.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,4 @@
44
RPYBUILD_PYBIND11_MODULE(m)
55
{
66
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-
});
237
}

tests/test_ft_misc.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,6 @@
22
import pytest
33
import re
44

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-
245
#
256
# abstract.h
267
#

0 commit comments

Comments
 (0)