summary refs log tree commit diff stats
path: root/plugins/python
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-05-09 22:55:06 -0300
committerTingPing <tngpng@gmail.com>2013-05-09 22:55:06 -0300
commit494364d437fb2594e00e78658b27f1d3add6cc1f (patch)
treed1f2835df0eff8827c7b3c77fe1b830c19c48370 /plugins/python
parentdba9c424733aef64f984bb1f49bf76ee8de79100 (diff)
Fix returning gtkwin_ptr from python api
Diffstat (limited to 'plugins/python')
-rw-r--r--plugins/python/python.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 4ea34c23..f3df501a 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -88,8 +88,10 @@
 
 #undef PyUnicode_Check
 #undef PyUnicode_FromString
+#undef PyUnicode_FromFormat
 #define PyUnicode_Check PyString_Check
 #define PyUnicode_AsFormat PyString_AsFormat
+#define PyUnicode_FromFormat PyString_FromFormat
 #define PyUnicode_FromString PyString_FromString
 #define PyUnicode_AsUTF8 PyString_AsString
 
@@ -1502,7 +1504,10 @@ Module_hexchat_get_info(PyObject *self, PyObject *args)
 		Py_INCREF(Py_None);
 		return Py_None;
 	}
-	return PyUnicode_FromString(info);
+	if (strcmp (name, "gtkwin_ptr") == 0)
+		return PyUnicode_FromFormat("%p", info); /* format as pointer */
+	else
+		return PyUnicode_FromString(info);
 }
 
 static PyObject *