From 091916614539c01e571486f2a55c68f87bd435bf Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Tue, 13 Oct 2020 01:37:39 +0300 Subject: Fixed building with Python 3.9. PyUnicode_GET_SIZE() in deprecated since 3.3 and will be removed in 3.12. In version 3.9 it was explicitly marked by deprecation warning causing compilation error with Unit. PyUnicode_GET_LENGTH() must be used instead. --- src/python/nxt_python_wsgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/python/nxt_python_wsgi.c') diff --git a/src/python/nxt_python_wsgi.c b/src/python/nxt_python_wsgi.c index 97030cd3..8f692941 100644 --- a/src/python/nxt_python_wsgi.c +++ b/src/python/nxt_python_wsgi.c @@ -831,7 +831,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args) fields_size += PyBytes_GET_SIZE(string); } else if (PyUnicode_Check(string)) { - fields_size += PyUnicode_GET_SIZE(string); + fields_size += PyUnicode_GET_LENGTH(string); } else { return PyErr_Format(PyExc_TypeError, @@ -843,7 +843,7 @@ nxt_py_start_resp(PyObject *self, PyObject *args) fields_size += PyBytes_GET_SIZE(string); } else if (PyUnicode_Check(string)) { - fields_size += PyUnicode_GET_SIZE(string); + fields_size += PyUnicode_GET_LENGTH(string); } else { return PyErr_Format(PyExc_TypeError, -- cgit