mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
scripts: fix script interpreter used after register during load of script in python/perl/ruby/lua/guile plugins (bug #41345)
This commit is contained in:
@@ -143,6 +143,7 @@ weechat_python_api_register (PyObject *self, PyObject *args)
|
||||
"version %s (%s)"),
|
||||
PYTHON_PLUGIN_NAME, name, version, description);
|
||||
}
|
||||
python_current_script->interpreter = (PyThreadState *)python_current_interpreter;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -49,6 +49,7 @@ struct t_plugin_script *python_current_script = NULL;
|
||||
struct t_plugin_script *python_registered_script = NULL;
|
||||
const char *python_current_script_filename = NULL;
|
||||
PyThreadState *python_mainThreadState = NULL;
|
||||
PyThreadState *python_current_interpreter = NULL;
|
||||
char *python2_bin = NULL;
|
||||
|
||||
/* outputs subroutines */
|
||||
@@ -590,7 +591,6 @@ weechat_python_load (const char *filename)
|
||||
wchar_t *wargv[] = { NULL, NULL };
|
||||
#endif
|
||||
FILE *fp;
|
||||
PyThreadState *python_current_interpreter;
|
||||
PyObject *weechat_outputs, *python_path, *path;
|
||||
const char *weechat_home;
|
||||
char *str_home;
|
||||
@@ -754,7 +754,6 @@ weechat_python_load (const char *filename)
|
||||
}
|
||||
python_current_script = python_registered_script;
|
||||
|
||||
python_current_script->interpreter = (PyThreadState *) python_current_interpreter;
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
|
||||
/*
|
||||
|
||||
@@ -42,6 +42,7 @@ extern struct t_plugin_script *last_python_script;
|
||||
extern struct t_plugin_script *python_current_script;
|
||||
extern struct t_plugin_script *python_registered_script;
|
||||
extern const char *python_current_script_filename;
|
||||
extern PyThreadState *python_current_interpreter;
|
||||
|
||||
extern PyObject *weechat_python_hashtable_to_dict (struct t_hashtable *hashtable);
|
||||
extern struct t_hashtable *weechat_python_dict_to_hashtable (PyObject *dict,
|
||||
|
||||
Reference in New Issue
Block a user