Mercurial > cpython-lru_cache-weakref
diff Objects/stringlib/partition.h @ 39734:cfb77fff0240 legacy-trunk
Fix endcase for str.rpartition()
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Mon, 04 Sep 2006 15:32:48 +0000 |
| parents | 5b0753b9d16a |
| children | e38335d4df91 ddf61cd775e0 |
line wrap: on
line diff
--- a/Objects/stringlib/partition.h Sun Sep 03 01:20:46 2006 +0000 +++ b/Objects/stringlib/partition.h Mon Sep 04 15:32:48 2006 +0000 @@ -78,12 +78,12 @@ } if (pos < 0) { - Py_INCREF(str_obj); - PyTuple_SET_ITEM(out, 0, (PyObject*) str_obj); + Py_INCREF(STRINGLIB_EMPTY); + PyTuple_SET_ITEM(out, 0, (PyObject*) STRINGLIB_EMPTY); Py_INCREF(STRINGLIB_EMPTY); PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY); - Py_INCREF(STRINGLIB_EMPTY); - PyTuple_SET_ITEM(out, 2, (PyObject*) STRINGLIB_EMPTY); + Py_INCREF(str_obj); + PyTuple_SET_ITEM(out, 2, (PyObject*) str_obj); return out; }
