Skip to content

Commit 5f2af62

Browse files
Add a missing function!
1 parent a4e4902 commit 5f2af62

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

include/pybind11/detail/internals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ inline object get_python_state_dict() {
365365
#else
366366
PyInterpreterState *istate = non_limited_api::PyInterpreterState_Get();
367367
if (istate) {
368-
state_dict = reinterpret_borrow<object>(PyInterpreterState_GetDict(istate));
368+
state_dict = reinterpret_borrow<object>(non_limited_api::PyInterpreterState_GetDict(istate));
369369
}
370370
#endif
371371
if (!state_dict) {

include/pybind11/detail/non_limited_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ PYBIND11_NONLIMITEDAPI_FUNC(PyStatus_ *, Py_InitializeFromConfig, (const PyConfi
182182
PYBIND11_NONLIMITEDAPI_FUNC(bool, PyObjectIsInstanceWithOneOfTpNames, (PyObject *obj, std::initializer_list<const char *> tp_names), (obj, tp_names))
183183
PYBIND11_NONLIMITEDAPI_FUNC(int, PyGen_Check_, (PyObject *obj), (obj))
184184
PYBIND11_NONLIMITEDAPI_FUNC(PyInterpreterState *, PyInterpreterState_Get, (), ())
185+
PYBIND11_NONLIMITEDAPI_FUNC(PyObject *, PyInterpreterState_GetDict, (PyInterpreterState *state), (state))
185186

186187
PYBIND11_NAMESPACE_END(non_limited_api)
187188
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)

source/non_limited_api/non_limited_api.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ int pybind11::non_limited_api::pybind11NLA_PyStatus_Exception (con
5353
const char *pybind11::non_limited_api::pybind11NLA_PyStatus_get_err_msg (const PyStatus_ *s) {return ((PyStatus *)s)->err_msg;}
5454
PyStatus_ * pybind11::non_limited_api::pybind11NLA_Py_InitializeFromConfig (const PyConfig *config) {return (PyStatus_ *)new PyStatus(::Py_InitializeFromConfig(config));}
5555
int pybind11::non_limited_api::pybind11NLA_PyGen_Check_ (PyObject *obj) {return PyGen_Check(obj);}
56+
PyObject * pybind11::non_limited_api::pybind11NLA_PyInterpreterState_GetDict(PyInterpreterState *state) {return ::PyInterpreterState_GetDict(state);}
5657

5758
// -------- STATIC FUNCTIONS:
5859

0 commit comments

Comments
 (0)