Doc: define PY_SSIZE_T_CLEAN always (GH-12794)

This commit is contained in:
Inada Naoki 2019-04-13 10:46:21 +09:00 committed by GitHub
parent a304b136ad
commit c88feceb44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 4 deletions

View file

@ -280,6 +280,7 @@ solution then is to call :c:func:`PyParser_ParseString` and test for ``e.error``
equal to ``E_EOF``, which means the input is incomplete. Here's a sample code
fragment, untested, inspired by code from Alex Farber::
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <node.h>
#include <errcode.h>
@ -318,6 +319,7 @@ complete example using the GNU readline library (you may want to ignore
#include <stdio.h>
#include <readline.h>
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <object.h>
#include <compile.h>