Skip to content

Commit 829a7a2

Browse files
committed
_PyInterpreterState_Get() has become public in Python 3.13
Since 3.13.0a1 it has been renamed to PyInterpreterStateGet() Source: python/cpython#106321
1 parent a971c11 commit 829a7a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

psycopg/utils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,10 @@ psyco_set_error(PyObject *exc, cursorObject *curs, const char *msg)
392392
static int
393393
psyco_is_main_interp(void)
394394
{
395-
#if PY_VERSION_HEX >= 0x03080000
395+
#if PY_VERSION_HEX >= 0x030d0000
396+
/* tested with Python 3.13.0a6 */
397+
return PyInterpreterState_Get() == PyInterpreterState_Main();
398+
#elif PY_VERSION_HEX >= 0x03080000
396399
/* tested with Python 3.8.0a2 */
397400
return _PyInterpreterState_Get() == PyInterpreterState_Main();
398401
#else

0 commit comments

Comments
 (0)