Skip to content

Commit

Permalink
[mypyc] Add Python 3.12 feature macro (#15465)
Browse files Browse the repository at this point in the history
It's currently unused but I have other PRs that will need this.

We can later make this more general and support things like "are we
running on Python 3.12 beta 2 or later", but this seems good enough for
now.
  • Loading branch information
JukkaL committed Jun 19, 2023
1 parent 32d14ed commit 719e7e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mypyc/lib-rt/mypyc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ static inline CPyTagged CPyTagged_ShortFromSsize_t(Py_ssize_t x) {
return x << 1;
}

// Are we targeting Python 3.12 or newer?
#define CPY_3_12_FEATURES (PY_VERSION_HEX >= 0x030c0000)

#endif

0 comments on commit 719e7e7

Please sign in to comment.