Skip to content

Commit c6bdd31

Browse files
committed
Sync some things that were split out into pybind#5665
1 parent 1e44f98 commit c6bdd31

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

docs/advanced/embedding.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,6 @@ naturally:
212212
assert(locals["message"].cast<std::string>() == "1 + 2 = 3");
213213
}
214214
215-
``PYBIND11_EMBEDDED_MODULE`` also accepts
216-
:func:`py::mod_gil_not_used()`,
217-
:func:`py::multiple_interpreters::per_interpreter_gil()`, and
218-
:func:`py::multiple_interpreters::shared_gil()` tags just like ``PYBIND11_MODULE``.
219-
See :ref:`misc_subinterp` and :ref:`misc_free_threading` for more information.
220-
221215
222216
Interpreter lifetime
223217
====================

docs/advanced/misc.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ following checklist.
155155
within pybind11 that will throw exceptions on certain GIL handling errors
156156
(reference counting operations).
157157

158-
.. _misc_free_threading:
159-
160158
Free-threading support
161159
==================================================================
162160

@@ -180,8 +178,6 @@ your code is thread safe. Modules must still be built against the Python free-t
180178
enable free-threading, even if they specify this tag. Adding this tag does not break
181179
compatibility with non-free-threaded Python.
182180

183-
.. _misc_subinterp:
184-
185181
Sub-interpreter support
186182
==================================================================
187183

tests/test_embed/test_subinterpreter.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,13 @@ TEST_CASE("Per-Subinterpreter GIL") {
339339
T_REQUIRE(caught);
340340

341341
// widget_module did provide the per_interpreter_gil tag, so it this does not throw
342-
py::module_::import("widget_module");
342+
try {
343+
py::module_::import("widget_module");
344+
caught = false;
345+
} catch (pybind11::error_already_set &) {
346+
caught = true;
347+
}
348+
T_REQUIRE(!caught);
343349

344350
T_REQUIRE(!py::hasattr(py::module_::import("external_module"), "multi_interp"));
345351
py::module_::import("external_module").attr("multi_interp") = std::to_string(num);

0 commit comments

Comments
 (0)