[anjuta] python-loader: Fix build with python3 (bgo#633786)



commit 099fdf58df2c7e19ee56c6a5ca373ee9817c2b3b
Author: Johannes Schmid <jhs gnome org>
Date:   Sat Feb 19 14:40:37 2011 +0100

    python-loader: Fix build with python3 (bgo#633786)

 plugins/python-loader/plugin.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/python-loader/plugin.c b/plugins/python-loader/plugin.c
index 8992b7b..c7cd2f0 100644
--- a/plugins/python-loader/plugin.c
+++ b/plugins/python-loader/plugin.c
@@ -56,8 +56,11 @@ pyl_ianjuta_plugin_factory_new_plugin (IAnjutaPluginFactory *factory,
 			if (module_path != NULL)
 				{
 					PyObject *sys_path = PySys_GetObject ("path");
+#if PY_MAJOR_VERSION >= 3
+					PyObject *path = PyBytes_FromString (module_path);
+#else
 					PyObject *path = PyString_FromString (module_path);
-
+#endif
 					if (PySequence_Contains(sys_path, path) == 0)
 						PyList_Insert (sys_path, 0, path);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]