finch/libgnt/gntwm.c

branch
release-2.x.y
changeset 35563
922e7abddb4d
parent 35561
c8bb4edd6325
child 35578
e0826e3b631b
child 35986
5dc98ddc6a9a
--- a/finch/libgnt/gntwm.c	Thu Feb 13 20:22:10 2014 -0500
+++ b/finch/libgnt/gntwm.c	Thu Feb 13 20:33:18 2014 -0500
@@ -1577,7 +1577,17 @@
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "run-python", run_python,
 				GNT_KEY_F3, NULL);
 	if (!Py_IsInitialized()) {
+#if PY_MAJOR_VERSION >= 3
+		wchar_t *name;
+		size_t len;
+		len = mbstowcs(NULL, "gnt", 0);
+		name = g_new(wchar_t, len + 1);
+		mbstowcs(name, "gnt", len + 1);
+		Py_SetProgramName(name);
+		g_free(name);
+#else
 		Py_SetProgramName("gnt");
+#endif
 		Py_Initialize();
 		started_python = TRUE;
 	}

mercurial