From 7b2b673ae2640ce9ad396f538fc25acb6e4405ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=93ZES=20=C3=81d=C3=A1m=20Istv=C3=A1n?= Date: Fri, 18 Sep 2015 17:42:26 +0200 Subject: [PATCH] python-dest: Replace deprecated function calls. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit replaces all PyString_FromString calls to PyBytes_FromString call. It will be compatible with the python2.6+ libraries, because this change was made in the python headers, too. Signed-off-by: MÓZES Ádám István --- modules/python/python-debugger.c | 2 +- modules/python/python-logmsg.c | 2 +- modules/python/python-tf.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/python/python-debugger.c b/modules/python/python-debugger.c index a7ff6d0466..4975d4252b 100644 --- a/modules/python/python-debugger.c +++ b/modules/python/python-debugger.c @@ -34,7 +34,7 @@ _add_nv_keys_to_list(gpointer key, gpointer value, gpointer user_data) PyObject *list = (PyObject *) user_data; const gchar *name = (const gchar *) key; - PyList_Append(list, PyString_FromString(name)); + PyList_Append(list, PyBytes_FromString(name)); } static PyObject * diff --git a/modules/python/python-logmsg.c b/modules/python/python-logmsg.c index ae83e480b7..5463010cdc 100644 --- a/modules/python/python-logmsg.c +++ b/modules/python/python-logmsg.c @@ -45,7 +45,7 @@ py_log_message_getattr(PyLogMessage *self, gchar *name) PyErr_SetString(PyExc_AttributeError, "No such attribute"); return NULL; } - return PyString_FromString(value); + return PyBytes_FromString(value); } static void diff --git a/modules/python/python-tf.c b/modules/python/python-tf.c index 5cd4fc9808..04103fb3c7 100644 --- a/modules/python/python-tf.c +++ b/modules/python/python-tf.c @@ -39,7 +39,7 @@ _py_construct_args_tuple(LogMessage *msg, gint argc, GString *argv[]) PyTuple_SetItem(args, 0, py_log_message_new(msg)); for (i = 1; i < argc; i++) { - PyTuple_SetItem(args, i, PyString_FromString(argv[i]->str)); + PyTuple_SetItem(args, i, PyBytes_FromString(argv[i]->str)); } return args; }