(original) (raw)

changeset: 100108:d0b4be7d2134 branch: 2.7 user: Serhiy Storchaka storchaka@gmail.com date: Fri Jan 29 00:55:37 2016 +0200 files: Modules/_testcapimodule.c description: Fixed a crash in new tests in test_getargs2 added in 60a2d67dacb3 (issue #26198). diff -r 82ee3c24bb86 -r d0b4be7d2134 Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c Fri Jan 29 00:37:28 2016 +0200 +++ b/Modules/_testcapimodule.c Fri Jan 29 00:55:37 2016 +0200 @@ -1149,7 +1149,7 @@ getargs_s_hash(PyObject *self, PyObject *args) { const char *str; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "s#", &str, &size)) return NULL; return PyBytes_FromStringAndSize(str, size); @@ -1159,7 +1159,7 @@ getargs_t_hash(PyObject *self, PyObject *args) { const char *str; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "t#", &str, &size)) return NULL; return PyBytes_FromStringAndSize(str, size); @@ -1198,7 +1198,7 @@ getargs_z_hash(PyObject *self, PyObject *args) { const char *str; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "z#", &str, &size)) return NULL; if (str != NULL) @@ -1228,7 +1228,7 @@ getargs_w_hash(PyObject *self, PyObject *args) { char *str; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "w#", &str, &size)) return NULL; @@ -1277,7 +1277,7 @@ getargs_u(PyObject *self, PyObject *args) { const Py_UNICODE *str; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "u", &str)) return NULL; size = _ustrlen(str); @@ -1288,7 +1288,7 @@ getargs_u_hash(PyObject *self, PyObject *args) { const Py_UNICODE *str; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "u#", &str, &size)) return NULL; return PyUnicode_FromUnicode(str, size); @@ -1335,7 +1335,7 @@ const char *encoding = NULL; PyByteArrayObject *buffer = NULL; char *str = NULL; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "O|sO!", &arg, &encoding, &PyByteArray_Type, &buffer)) @@ -1359,7 +1359,7 @@ const char *encoding = NULL; PyByteArrayObject *buffer = NULL; char *str = NULL; - Py_ssize_t size; + int size; if (!PyArg_ParseTuple(args, "O|sO!", &arg, &encoding, &PyByteArray_Type, &buffer)) /storchaka@gmail.com