Files
macports-ports/python/py-macfsevents/files/patch-remove-PyEval_ThreadsInitialized.diff
2026-02-20 22:06:57 -05:00

18 lines
599 B
Diff

diff --git a/_fsevents.c b/_fsevents.c
index 8bf01ab..31eeef3 100644
--- a/_fsevents.c
+++ b/_fsevents.c
@@ -94,9 +94,11 @@ static PyObject* pyfsevents_loop(PyObject* self, PyObject* args) {
PyObject* thread;
if (!PyArg_ParseTuple(args, "O:loop", &thread))
return NULL;
- if (! PyEval_ThreadsInitialized()) {
+#if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7)
+ if (!PyEval_ThreadsInitialized()) {
PyEval_InitThreads();
}
+#endif
/* allocate info and store thread state */
PyObject* value = PyDict_GetItem(loops, thread);