Skip to content

Commit 27969fc

Browse files
committed
Maintain compatibility with CPython 3.13
1 parent c5bed09 commit 27969fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cassandra/io/libevwrapper.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,14 @@ initlibevwrapper(void)
665665
if (PyModule_AddObject(module, "Timer", (PyObject *)&libevwrapper_TimerType) == -1)
666666
INITERROR;
667667

668+
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 7
669+
// Since CPython 3.7, `Py_Initialize()` routing always initializes GIL.
670+
// Routine `PyEval_ThreadsInitialized()` has been deprecated in CPython 3.7
671+
// and completely removed in CPython 3.13.
668672
if (!PyEval_ThreadsInitialized()) {
669673
PyEval_InitThreads();
670674
}
675+
#endif
671676

672677
#if PY_MAJOR_VERSION >= 3
673678
return module;

0 commit comments

Comments
 (0)