diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-05-15 10:10:27 -0700 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-05-15 10:10:27 -0700 |
commit | 77fa9379e2fd9c074b4c002c0fd5d43caca80fff (patch) | |
tree | 31579855124ad12ff3fa985f081164966820b472 /Parser/asdl_c.py | |
parent | c5f31ed63d7db6f7e13112790d15a6274ca7c2cf (diff) | |
download | cpython-git-77fa9379e2fd9c074b4c002c0fd5d43caca80fff.tar.gz |
use Py_ssize_t for ast sequence lengths
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-x | Parser/asdl_c.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 81a3d6af58..769f73f0cb 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -784,7 +784,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) @@ -1106,7 +1106,7 @@ class ObjVisitor(PickleVisitor): # While the sequence elements are stored as void*, # ast2obj_cmpop expects an enum self.emit("{", depth) - self.emit("int i, n = asdl_seq_LEN(%s);" % value, depth+1) + self.emit("Py_ssize_t i, n = asdl_seq_LEN(%s);" % value, depth+1) self.emit("value = PyList_New(n);", depth+1) self.emit("if (!value) goto failed;", depth+1) self.emit("for(i = 0; i < n; i++)", depth+1) |