mirror of
https://github.com/weechat/weechat.git
synced 2026-06-24 11:56:38 +02:00
python: fix crash when loading a script with Python >= 3.7 (closes #1219)
This commit is contained in:
@@ -1561,7 +1561,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
/* PyEval_InitThreads(); */
|
||||
/* python_mainThreadState = PyThreadState_Swap(NULL); */
|
||||
#if PY_VERSION_HEX >= 0x03070000
|
||||
python_mainThreadState = PyThreadState_Get();
|
||||
#else
|
||||
python_mainThreadState = PyEval_SaveThread();
|
||||
#endif
|
||||
/* PyEval_ReleaseLock (); */
|
||||
|
||||
if (!python_mainThreadState)
|
||||
|
||||
Reference in New Issue
Block a user