Skip to content

Commit

Permalink
Skip calling PyEval_InitThreads() on CPython 3.7+
Browse files Browse the repository at this point in the history
Since CPython 3.7 `PyEval_InitThreads()` does nothing and the function
has been deprecated since CPython 3.9.
  • Loading branch information
bstaletic committed Jan 6, 2021
1 parent 98cb3dd commit f9d10b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/watchdog_fsevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ watchdog_read_events(PyObject *self, PyObject *args)

G_RETURN_NULL_IF_NOT(PyArg_ParseTuple(args, "O:loop", &emitter_thread));

#if PY_VERSION_HEX < 0x030700f0
PyEval_InitThreads();
#endif

/* Allocate information and store thread state. */
value = PyDict_GetItem(thread_to_run_loop, emitter_thread);
Expand Down

0 comments on commit f9d10b0

Please sign in to comment.