diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c index dcd72fc..2dca4ff 100644 --- a/finch/libgnt/gntwm.c +++ b/finch/libgnt/gntwm.c @@ -1281,7 +1281,11 @@ python_script_selected(GntFileSel *fs, const char *path, const char *f, gpointer { char *dir = g_path_get_dirname(path); FILE *file = fopen(path, "r"); +#if PY_MAJOR_VERSION >= 3 + PyObject *pp = PySys_GetObject("path"), *dirobj = PyUnicode_FromString(dir); +#else PyObject *pp = PySys_GetObject("path"), *dirobj = PyString_FromString(dir); +#endif PyList_Insert(pp, 0, dirobj); Py_DECREF(dirobj);