gh-143012: use Py_ssize_t cast for PyBytes_FromStringAndSize (#143013)

This commit is contained in:
AZero13 2025-12-20 02:37:10 -05:00 committed by GitHub
parent 5b5263648f
commit 5989095dfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1815,7 +1815,7 @@ convertenviron(void)
#ifdef MS_WINDOWS
k = PyUnicode_FromWideChar(*e, (Py_ssize_t)(p-*e));
#else
k = PyBytes_FromStringAndSize(*e, (int)(p-*e));
k = PyBytes_FromStringAndSize(*e, (Py_ssize_t)(p-*e));
#endif
if (k == NULL) {
Py_DECREF(d);