mirror of
https://github.com/weechat/weechat.git
synced 2026-06-22 19:06:37 +02:00
python: fix load of scripts with python >= 3.3
This commit is contained in:
@@ -659,7 +659,13 @@ weechat_python_load (const char *filename)
|
||||
if (str_home)
|
||||
{
|
||||
snprintf (str_home, len, "%s/python", weechat_home);
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
/* python >= 3.x */
|
||||
path = PyUnicode_FromString(str_home);
|
||||
#else
|
||||
/* python <= 2.x */
|
||||
path = PyBytes_FromString (str_home);
|
||||
#endif
|
||||
if (path != NULL)
|
||||
{
|
||||
PyList_Insert (python_path, 0, path);
|
||||
@@ -670,10 +676,10 @@ weechat_python_load (const char *filename)
|
||||
}
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
/* python 3.x (or newer) */
|
||||
/* python >= 3.x */
|
||||
weechat_outputs = PyModule_Create (&moduleDefOutputs);
|
||||
#else
|
||||
/* python 2.x */
|
||||
/* python <= 2.x */
|
||||
weechat_outputs = Py_InitModule("weechatOutputs",
|
||||
weechat_python_output_funcs);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user