]> granicus.if.org Git - python/commitdiff
array.buffer_info() should return a length as int, not long, for compatibility.
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 24 Jun 2016 05:38:59 +0000 (08:38 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 24 Jun 2016 05:38:59 +0000 (08:38 +0300)
Modules/arraymodule.c

index 53507597a2ab2345c9455e2974505c7ff9891e02..fcdd46a42f7c3f42619116707c70b827d8c05ccc 100644 (file)
@@ -1080,7 +1080,7 @@ array_buffer_info(arrayobject *self, PyObject *unused)
     }
     PyTuple_SET_ITEM(retval, 0, v);
 
-    v = PyLong_FromSsize_t(Py_SIZE(self));
+    v = PyInt_FromSsize_t(Py_SIZE(self));
     if (v == NULL) {
         Py_DECREF(retval);
         return NULL;