Skip to content

Commit

Permalink
_PyInterpreterState_Get() has become public in Python 3.13
Browse files Browse the repository at this point in the history
Since 3.13.0a1 it has been renamed to PyInterpreterStateGet()
Source: python/cpython#106321
  • Loading branch information
befeleme committed Apr 24, 2024
1 parent a971c11 commit 829a7a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion psycopg/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,10 @@ psyco_set_error(PyObject *exc, cursorObject *curs, const char *msg)
static int
psyco_is_main_interp(void)
{
#if PY_VERSION_HEX >= 0x03080000
#if PY_VERSION_HEX >= 0x030d0000
/* tested with Python 3.13.0a6 */
return PyInterpreterState_Get() == PyInterpreterState_Main();
#elif PY_VERSION_HEX >= 0x03080000
/* tested with Python 3.8.0a2 */
return _PyInterpreterState_Get() == PyInterpreterState_Main();
#else
Expand Down

0 comments on commit 829a7a2

Please sign in to comment.