mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 22:52:01 +00:00
continue to use PyEval_GetBuiltins for PyPy
This commit is contained in:
parent
f4e6c7833e
commit
cc03a56512
@ -423,7 +423,7 @@ PYBIND11_NOINLINE internals &get_internals() {
|
|||||||
str id(id_cstr);
|
str id(id_cstr);
|
||||||
|
|
||||||
dict state_dict;
|
dict state_dict;
|
||||||
#if PY_VERSION_HEX < 0x03080000
|
#if PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)
|
||||||
state_dict = reinterpret_borrow<dict>(PyEval_GetBuiltins());
|
state_dict = reinterpret_borrow<dict>(PyEval_GetBuiltins());
|
||||||
#elif PY_VERSION_HEX < 0x03090000
|
#elif PY_VERSION_HEX < 0x03090000
|
||||||
state_dict = reinterpret_borrow<dict>(PyInterpreterState_GetDict(_PyInterpreterState_Get()));
|
state_dict = reinterpret_borrow<dict>(PyInterpreterState_GetDict(_PyInterpreterState_Get()));
|
||||||
|
@ -170,7 +170,7 @@ TEST_CASE("There can be only one interpreter") {
|
|||||||
|
|
||||||
bool has_pybind11_internals_builtin() {
|
bool has_pybind11_internals_builtin() {
|
||||||
py::dict state_dict;
|
py::dict state_dict;
|
||||||
#if PY_VERSION_HEX < 0x03080000
|
#if PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)
|
||||||
state_dict = py::reinterpret_borrow<py::dict>(PyEval_GetBuiltins());
|
state_dict = py::reinterpret_borrow<py::dict>(PyEval_GetBuiltins());
|
||||||
#elif PY_VERSION_HEX < 0x03090000
|
#elif PY_VERSION_HEX < 0x03090000
|
||||||
state_dict
|
state_dict
|
||||||
|
Loading…
Reference in New Issue
Block a user