File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,9 @@ inline uint64_t round_up_to_next_pow2(uint64_t x) {
445445
446446template <typename InternalsType>
447447inline InternalsType **find_or_create_internals_pp (char const *state_dict_key) {
448+ #if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
449+ gil_scoped_acquire gil;
450+ #else
448451 // Ensure that the GIL is held since we will need to make Python calls.
449452 // Cannot use py::gil_scoped_acquire here since that constructor calls get_internals.
450453 struct gil_scoped_acquire_local {
@@ -454,6 +457,7 @@ inline InternalsType **find_or_create_internals_pp(char const *state_dict_key) {
454457 ~gil_scoped_acquire_local () { PyGILState_Release (state); }
455458 const PyGILState_STATE state;
456459 } gil;
460+ #endif
457461
458462 error_scope err_scope;
459463
You can’t perform that action at this time.
0 commit comments