Skip to content

Commit

Permalink
Catch up with pybind/pybind11#4570 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Mar 27, 2023
1 parent 5ec5efd commit bd5687f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/pybind11/detail/abi_platform_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@
# define PYBIND11_INTERNALS_VERSION 4
# endif
#endif

// This requirement is mainly to reduce the support burden (see PR #4570).
static_assert(PY_VERSION_HEX < 0x030C0000 || PYBIND11_INTERNALS_VERSION >= 5,
"pybind11 ABI version 5 is the minimum for Python 3.12+");
3 changes: 1 addition & 2 deletions include/pybind11/detail/cross_extension_shared_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ PYBIND11_NAMESPACE_BEGIN(detail)

inline object get_python_state_dict() {
object state_dict;
#if PY_VERSION_HEX < 0x03080000 \
|| (PYBIND11_INTERNALS_VERSION <= 4 && PY_VERSION_HEX < 0x030C0000) || defined(PYPY_VERSION)
#if PYBIND11_INTERNALS_VERSION <= 4 || PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)
state_dict = reinterpret_borrow<object>(PyEval_GetBuiltins());
#else
# if PY_VERSION_HEX < 0x03090000
Expand Down

0 comments on commit bd5687f

Please sign in to comment.