diff Python/Python-ast.c @ 76947:f4d7ad6c9d6e

Widen ASDL sequences to Py_ssize_t lengths to better match PEP 353.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 15 May 2012 14:45:03 +0200
parents 9e7f6ddc0d76
children 99ed87c8e24c
line wrap: on
line diff
--- a/Python/Python-ast.c	Tue May 15 14:34:58 2012 +0200
+++ b/Python/Python-ast.c	Tue May 15 14:45:03 2012 +0200
@@ -636,7 +636,7 @@
 
 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 @@
                         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++)