]> xenbits.xensource.com Git - xen.git/commit
tools/python: change 's#' size type for Python >= 3.10
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mon, 6 Feb 2023 07:50:13 +0000 (08:50 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 6 Feb 2023 07:50:13 +0000 (08:50 +0100)
commit897257ba49d0a6ddcf084960fd792ccce9c40f94
treebe5b0d4c1003da6c119b73492c4ea6c11163af46
parenta21c9e6ddfee6d21dff1f18c299cb94a47b32c9e
tools/python: change 's#' size type for Python >= 3.10

Python < 3.10 by default uses 'int' type for data+size string types
(s#), unless PY_SSIZE_T_CLEAN is defined - in which case it uses
Py_ssize_t. The former behavior was removed in Python 3.10 and now it's
required to define PY_SSIZE_T_CLEAN before including Python.h, and using
Py_ssize_t for the length argument. The PY_SSIZE_T_CLEAN behavior is
supported since Python 2.5.

Adjust bindings accordingly.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/lowlevel/xs/xs.c