diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-11-28 19:46:36 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-11-28 19:46:36 +0100 |
commit | 02fc4053c903a2d4b671f1b85b05f90a4d891612 (patch) | |
tree | e6a877daf01f8399674e7405d1928297eda719ca /src/plugins | |
parent | 74333b2270f768a3a7587a4cc51f03dbe522488a (diff) | |
download | weechat-02fc4053c903a2d4b671f1b85b05f90a4d891612.zip |
python: fix load of scripts with python >= 3.3
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/python/weechat-python.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index e74f9be0a..aeff3802c 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -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 |