From f10941e565d402e032948bb9711bfbab43eadd88 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:45:59 +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_AsString calls to PyBytes_AsString 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-helpers.c | 4 ++-- modules/python/python-tf.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/python/python-debugger.c b/modules/python/python-debugger.c index 4975d4252b..539ae9fbdd 100644 --- a/modules/python/python-debugger.c +++ b/modules/python/python-debugger.c @@ -99,7 +99,7 @@ python_fetch_debugger_command(void) Py_DECREF(ret); goto exit; } - command = g_strdup(PyString_AsString(ret)); + command = g_strdup(PyBytes_AsString(ret)); Py_DECREF(ret); exit: PyGILState_Release(gstate); diff --git a/modules/python/python-helpers.c b/modules/python/python-helpers.c index 7400cf732c..beb5f7b301 100644 --- a/modules/python/python-helpers.c +++ b/modules/python/python-helpers.c @@ -31,7 +31,7 @@ _py_get_callable_name(PyObject *callable, gchar *buf, gsize buf_len) if (name) { - g_strlcpy(buf, PyString_AsString(name), buf_len); + g_strlcpy(buf, PyBytes_AsString(name), buf_len); } else { @@ -58,7 +58,7 @@ _py_format_exception_text(gchar *buf, gsize buf_len) str = PyObject_Str(value); if (str) { - g_snprintf(buf, buf_len, "%s: %s", ((PyTypeObject *) exc)->tp_name, PyString_AsString(str)); + g_snprintf(buf, buf_len, "%s: %s", ((PyTypeObject *) exc)->tp_name, PyBytes_AsString(str)); } else { diff --git a/modules/python/python-tf.c b/modules/python/python-tf.c index 04103fb3c7..4b36605183 100644 --- a/modules/python/python-tf.c +++ b/modules/python/python-tf.c @@ -90,7 +90,7 @@ _py_convert_return_value_to_result(const gchar *function_name, PyObject *ret, GS Py_DECREF(ret); return FALSE; } - g_string_append(result, PyString_AS_STRING(ret)); + g_string_append(result, PyBytes_AS_STRING(ret)); Py_DECREF(ret); return TRUE; }