Skip to content

Silence Python 3.8 PY_SSIZE_T_CLEAN warning

In Python 3, PyArg_ParseTuple and friends can return either an int or a Py_ssize_t type for the length in an argument of the form "s#", "y#", "u#", etc, controlled by whether the preprocessor macro PY_SSIZE_T_CLEAN is defined when the header Python.h is included. A future version of Python will only support PY_SSIZE_T. In Python 3.8, there was a deprecation warning added (see https://bugs.python.org/issue36381).

Define the PY_SSIZE_T_CLEAN macro to suppress the hundreds or thousands of deprecation warnings that may be printed when reading a LIGO_LW file.

See also lscsoft/glue!69 (closed).

Merge request reports