1
0
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:
Sebastien Helleu
2013-11-28 19:46:36 +01:00
parent 74333b2270
commit 02fc4053c9
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -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