python: clear warnings about PY_SSIZE_T_CLEAN (#55561)

Using the python3 bindings on recent python3 >=3.8 versions shows:

   DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats

https://docs.python.org/3.9/whatsnew/changelog.html?highlight=py_ssize_t_clean#id193
This commit is contained in:
Benjamin Dauvergne 2021-07-13 13:21:01 +02:00
parent b6321b4db2
commit 149de8cd0b
1 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,8 @@
#include "../../lasso/utils.h"
#include "../utils.c"
#define PY_SSIZE_T_CLEAN
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX