/pidgin/main: c8bb4edd6325: Fix build of Finch against Python3.

Ed Catmur ed at catmur.co.uk
Thu Feb 13 20:22:26 EST 2014


Changeset: c8bb4edd63253b5b23006e8674c015c854075981
Author:	 Ed Catmur <ed at catmur.co.uk>
Date:	 2014-02-13 20:16 -0500
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/c8bb4edd6325

Description:

Fix build of Finch against Python3.

Fixes #15969.

diffstat:

 ChangeLog            |  3 +++
 finch/libgnt/gntwm.c |  7 ++++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (30 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@ version 2.10.10:
 	Stuff:
 	* Stuff.
 
+	Finch:
+	* Fix build against Python 3. (Ed Catmur) (#15969)
+
 version 2.10.9 (2/2/2014):
 	XMPP:
 	* Fix problems logging into some servers including jabber.org and
diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c
--- a/finch/libgnt/gntwm.c
+++ b/finch/libgnt/gntwm.c
@@ -1281,7 +1281,12 @@ python_script_selected(GntFileSel *fs, c
 {
 	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);



More information about the Commits mailing list