Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 37858:74f459a289be legacy-trunk
Make s.replace() work with explicit counts exceeding 2Gb.
| author | Thomas Wouters <thomas@python.org> |
|---|---|
| date | Wed, 19 Apr 2006 15:38:01 +0000 |
| parents | dc8efd70ab56 |
| children | f9eca133cf88 |
line wrap: on
line diff
--- a/Objects/stringobject.c Wed Apr 19 15:27:33 2006 +0000 +++ b/Objects/stringobject.c Wed Apr 19 15:38:01 2006 +0000 @@ -2524,11 +2524,11 @@ char *new_s; const Py_ssize_t len = PyString_GET_SIZE(self); Py_ssize_t sub_len, repl_len, out_len; - int count = -1; + Py_ssize_t count = -1; PyObject *newobj; PyObject *subobj, *replobj; - if (!PyArg_ParseTuple(args, "OO|i:replace", + if (!PyArg_ParseTuple(args, "OO|n:replace", &subobj, &replobj, &count)) return NULL;
