Skip to content

Commit

Permalink
Relax PYPY_VERSION_NUM requirements for hash macros (#122)
Browse files Browse the repository at this point in the history
Those added in
pypy/pypy@5661dff
which is available in PyPy 7.3.8+.
  • Loading branch information
skirpichev authored Nov 15, 2024
1 parent 77abeec commit 03e441d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pythoncapi_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,11 @@ static inline int PyTime_PerfCounter(PyTime_t *result)
#endif

// gh-111389 added hash constants to Python 3.13.0a5. These constants were
// added first as private macros to Python 3.4.0b1 and PyPy 7.3.9.
// added first as private macros to Python 3.4.0b1 and PyPy 7.3.8.
#if (!defined(PyHASH_BITS) \
&& ((!defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x030400B1) \
|| (defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x03070000 \
&& PYPY_VERSION_NUM >= 0x07090000)))
&& PYPY_VERSION_NUM >= 0x07030800)))
# define PyHASH_BITS _PyHASH_BITS
# define PyHASH_MODULUS _PyHASH_MODULUS
# define PyHASH_INF _PyHASH_INF
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pythoncapi_compat_cext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ test_hash(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))

#if ((!defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x030400B1) \
|| (defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x03070000 \
&& PYPY_VERSION_NUM >= 0x07090000))
&& PYPY_VERSION_NUM >= 0x07030800))
// Just check that constants are available
size_t bits = PyHASH_BITS;
assert(bits >= 8);
Expand Down

0 comments on commit 03e441d

Please sign in to comment.