--- a/gntwm.c Thu Feb 13 21:59:24 2014 +0530
+++ b/gntwm.c Mon Feb 17 21:57:26 2014 +0530
@@ -1277,7 +1277,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); + PyObject *dirobj = PyString_FromString(dir); PyList_Insert(pp, 0, dirobj);
@@ -1568,7 +1573,17 @@
gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "run-python", run_python,
if (!Py_IsInitialized()) {
+#if PY_MAJOR_VERSION >= 3 + len = mbstowcs(NULL, "gnt", 0); + name = g_new(wchar_t, len + 1); + mbstowcs(name, "gnt", len + 1); + Py_SetProgramName(name); Py_SetProgramName("gnt");