# HG changeset patch # User Gregory Szorc # Date 1554416643 25200 # Node ID 668eff08387fb6e99825da8b3229506f9c753364 # Parent 896b19d12c084b2e6b66b69022454f9a01ec7fbd cext: make osutil.c PY_SSIZE_T_CLEAN This is needed to avoid a deprecation warning on Python 3.8. With this change, we no longer see deprecation warnings for this issue on Python 3.8. Differential Revision: https://phab.mercurial-scm.org/D6198 diff -r 896b19d12c08 -r 668eff08387f mercurial/cext/osutil.c --- a/mercurial/cext/osutil.c Thu Apr 04 15:21:30 2019 -0700 +++ b/mercurial/cext/osutil.c Thu Apr 04 15:24:03 2019 -0700 @@ -8,6 +8,7 @@ */ #define _ATFILE_SOURCE +#define PY_SSIZE_T_CLEAN #include #include #include @@ -227,7 +228,7 @@ kind, py_st); } -static PyObject *_listdir(char *path, int plen, int wantstat, char *skip) +static PyObject *_listdir(char *path, Py_ssize_t plen, int wantstat, char *skip) { PyObject *rval = NULL; /* initialize - return value */ PyObject *list; @@ -1181,7 +1182,8 @@ PyObject *statobj = NULL; /* initialize - optional arg */ PyObject *skipobj = NULL; /* initialize - optional arg */ char *path, *skip = NULL; - int wantstat, plen; + Py_ssize_t plen; + int wantstat; static char *kwlist[] = {"path", "stat", "skip", NULL};