mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Use Py_ssize_t for counts and sizes.
Convert Py_ssize_t using PyInt_FromSsize_t
This commit is contained in:
parent
ad0a4629be
commit
eb079f1c25
10 changed files with 33 additions and 31 deletions
|
|
@ -1170,7 +1170,7 @@ PySequence_Repeat(PyObject *o, Py_ssize_t count)
|
|||
to nb_multiply if o appears to be a sequence. */
|
||||
if (PySequence_Check(o)) {
|
||||
PyObject *n, *result;
|
||||
n = PyInt_FromLong(count);
|
||||
n = PyInt_FromSsize_t(count);
|
||||
if (n == NULL)
|
||||
return NULL;
|
||||
result = binary_op1(o, n, NB_SLOT(nb_multiply));
|
||||
|
|
@ -1222,7 +1222,7 @@ PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count)
|
|||
|
||||
if (PySequence_Check(o)) {
|
||||
PyObject *n, *result;
|
||||
n = PyInt_FromLong(count);
|
||||
n = PyInt_FromSsize_t(count);
|
||||
if (n == NULL)
|
||||
return NULL;
|
||||
result = binary_iop1(o, n, NB_SLOT(nb_inplace_multiply),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue