summaryrefslogtreecommitdiffhomepage
path: root/src/python/nxt_python.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2020-10-13 01:37:39 +0300
committerValentin Bartenev <vbart@nginx.com>2020-10-13 01:37:39 +0300
commit091916614539c01e571486f2a55c68f87bd435bf (patch)
tree8ab8a0f6ea217fd44ba8ed00d676ec3dd6a0b4eb /src/python/nxt_python.h
parentc4f2a58aaf1096e2c25a99ff204d7be1beec8fb5 (diff)
downloadunit-091916614539c01e571486f2a55c68f87bd435bf.tar.gz
unit-091916614539c01e571486f2a55c68f87bd435bf.tar.bz2
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.
Diffstat (limited to '')
-rw-r--r--src/python/nxt_python.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/python/nxt_python.h b/src/python/nxt_python.h
index 3211026b..3dd04e31 100644
--- a/src/python/nxt_python.h
+++ b/src/python/nxt_python.h
@@ -28,6 +28,7 @@
#define PyBytes_AS_STRING PyString_AS_STRING
#define PyUnicode_InternInPlace PyString_InternInPlace
#define PyUnicode_AsUTF8 PyString_AS_STRING
+#define PyUnicode_GET_LENGTH PyUnicode_GET_SIZE
#endif
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 5