mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Widen ASDL sequences to Py_ssize_t lengths to better match PEP 353.
This commit is contained in:
parent
33cac8578b
commit
cc10a37ef0
3 changed files with 8 additions and 8 deletions
|
@ -636,7 +636,7 @@ static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
|
|||
|
||||
static PyObject* ast2obj_list(asdl_seq *seq, PyObject* (*func)(void*))
|
||||
{
|
||||
int i, n = asdl_seq_LEN(seq);
|
||||
Py_ssize_t i, n = asdl_seq_LEN(seq);
|
||||
PyObject *result = PyList_New(n);
|
||||
PyObject *value;
|
||||
if (!result)
|
||||
|
@ -2857,7 +2857,7 @@ ast2obj_expr(void* _o)
|
|||
goto failed;
|
||||
Py_DECREF(value);
|
||||
{
|
||||
int i, n = asdl_seq_LEN(o->v.Compare.ops);
|
||||
Py_ssize_t i, n = asdl_seq_LEN(o->v.Compare.ops);
|
||||
value = PyList_New(n);
|
||||
if (!value) goto failed;
|
||||
for(i = 0; i < n; i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue