qulogic/libgnt

Fix build of Finch against Python3.
release-2.x.y
2014-02-13, Ed Catmur
2e4ab66cdbcf
Parents fabc15bbea63
Children c37afb64c6ad
Fix build of Finch against Python3.

Fixes #15969.
  • +6 -1
    gntwm.c
  • --- a/gntwm.c Tue Feb 26 20:39:20 2013 -0500
    +++ b/gntwm.c Thu Feb 13 20:16:25 2014 -0500
    @@ -1281,7 +1281,12 @@
    {
    char *dir = g_path_get_dirname(path);
    FILE *file = fopen(path, "r");
    - PyObject *pp = PySys_GetObject("path"), *dirobj = PyString_FromString(dir);
    + PyObject *pp = PySys_GetObject("path");
    +#if PY_MAJOR_VERSION >= 3
    + PyObject *dirobj = PyUnicode_FromString(dir);
    +#else
    + PyObject *dirobj = PyString_FromString(dir);
    +#endif
    PyList_Insert(pp, 0, dirobj);
    Py_DECREF(dirobj);