summary refs log tree commit diff stats
path: root/plugins/python
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-06-02 00:29:34 -0300
committerTingPing <tngpng@gmail.com>2013-06-02 00:29:34 -0300
commitc9b7a3f86eb410b2a088fbc76b30e7794100bd04 (patch)
tree6c059043d82fd17775c53d1b68f79642a11d2307 /plugins/python
parent43bd9483cee59d4f7c1aaa83878678cabefb7c78 (diff)
Python: return true/false from set/del_pluginpref
Diffstat (limited to 'plugins/python')
-rw-r--r--plugins/python/python.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 636c4cf9..51735e83 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -1619,7 +1619,7 @@ Module_hexchat_pluginpref_set(PyObject *self, PyObject *args)
 {
 	PluginObject *plugin = (PluginObject*)Plugin_GetCurrent();
 	hexchat_plugin *prefph = Plugin_GetHandle(plugin);
-	PyObject *result;
+	int result;
 	char *var;
 	PyObject *value;
 		
@@ -1628,18 +1628,18 @@ Module_hexchat_pluginpref_set(PyObject *self, PyObject *args)
 	if (PyLong_Check(value)) {
 		int intvalue = PyLong_AsLong(value);
 		BEGIN_XCHAT_CALLS(NONE);
-		result = PyLong_FromLong(hexchat_pluginpref_set_int(prefph, var, intvalue));
+		result = hexchat_pluginpref_set_int(prefph, var, intvalue);
 		END_XCHAT_CALLS();
 	}
 	else if (PyUnicode_Check(value)) {
 		char *charvalue = PyUnicode_AsUTF8(value);
 		BEGIN_XCHAT_CALLS(NONE);
-		result = PyLong_FromLong(hexchat_pluginpref_set_str(prefph, var, charvalue));
+		result = hexchat_pluginpref_set_str(prefph, var, charvalue);
 		END_XCHAT_CALLS();
 	}
 	else
-		result = PyLong_FromLong(0);
-	return result;
+		result = 0;
+	return PyBool_FromLong(result);
 }
 
 static PyObject *
@@ -1691,7 +1691,7 @@ Module_hexchat_pluginpref_delete(PyObject *self, PyObject *args)
 	BEGIN_XCHAT_CALLS(NONE);
 	result = hexchat_pluginpref_delete(prefph, var);
 	END_XCHAT_CALLS();
-	return PyLong_FromLong(result);
+	return PyBool_FromLong(result);
 }
 
 static PyObject *