Skip to content

Commit c607b41

Browse files
committed
fix: use not_supported()
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 918fb72 commit c607b41

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tests/test_cmake_build/embed.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
#include <pybind11/pybind11.h>
12
#include <pybind11/embed.h>
3+
24
namespace py = pybind11;
35

4-
PYBIND11_EMBEDDED_MODULE(test_cmake_build, m) {
6+
PYBIND11_EMBEDDED_MODULE(test_cmake_build, m, py::multiple_interpreters::not_supported()) {
57
m.def("add", [](int i, int j) { return i + j; });
68
}
79

tests/test_embed/test_interpreter.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <pybind11/critical_section.h>
22
#include <pybind11/embed.h>
3+
#include <pybind11/pybind11.h>
34

45
// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to
56
// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).
@@ -76,17 +77,19 @@ PYBIND11_EMBEDDED_MODULE(widget_module, m, py::multiple_interpreters::per_interp
7677
sub.def("add", [](int i, int j) { return i + j; });
7778
}
7879

79-
PYBIND11_EMBEDDED_MODULE(trampoline_module, m) {
80+
PYBIND11_EMBEDDED_MODULE(trampoline_module, m, py::multiple_interpreters::not_supported()) {
8081
py::class_<test_override_cache_helper,
8182
test_override_cache_helper_trampoline,
8283
std::shared_ptr<test_override_cache_helper>>(m, "test_override_cache_helper")
8384
.def(py::init_alias<>())
8485
.def("func", &test_override_cache_helper::func);
8586
}
8687

87-
PYBIND11_EMBEDDED_MODULE(throw_exception, ) { throw std::runtime_error("C++ Error"); }
88+
PYBIND11_EMBEDDED_MODULE(throw_exception, , py::multiple_interpreters::not_supported()) {
89+
throw std::runtime_error("C++ Error");
90+
}
8891

89-
PYBIND11_EMBEDDED_MODULE(throw_error_already_set, ) {
92+
PYBIND11_EMBEDDED_MODULE(throw_error_already_set, , py::multiple_interpreters::not_supported()) {
9093
auto d = py::dict();
9194
d["missing"].cast<py::object>();
9295
}

0 commit comments

Comments
 (0)