X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=srd.c;h=10dfaf6c1db5690dbc00917f580aba1adf08c176;hp=35ec5f2e9b7761f8847d957affd0935b2ed39677;hb=HEAD;hpb=1105c425345961fa527a7994845bc487b1c7bdf5 diff --git a/srd.c b/srd.c index 35ec5f2..10dfaf6 100644 --- a/srd.c +++ b/srd.c @@ -302,8 +302,14 @@ SRD_API int srd_init(const char *path) g_strfreev(dir_list); } - /* Initialize the Python GIL (this also happens to acquire it). */ +#if PY_VERSION_HEX < 0x03090000 + /* + * Initialize and acquire the Python GIL. In Python 3.7+ this + * will be done implicitly as part of the Py_InitializeEx() + * call above. PyEval_InitThreads() was deprecated in 3.9. + */ PyEval_InitThreads(); +#endif /* Release the GIL (ignore return value, we don't need it here). */ (void)PyEval_SaveThread();