Typo in bytes.replace(): the buffer interface was always used.

This commit is contained in:
Amaury Forgeot d'Arc 2007-11-22 02:55:35 +00:00
parent 39599dca9d
commit 4d279c1f80
1 changed files with 1 additions and 1 deletions

View File

@ -2594,7 +2594,7 @@ string_replace(PyStringObject *self, PyObject *args)
from_s = PyString_AS_STRING(from); from_s = PyString_AS_STRING(from);
from_len = PyString_GET_SIZE(from); from_len = PyString_GET_SIZE(from);
} }
if (PyUnicode_Check(from)) else if (PyUnicode_Check(from))
return PyUnicode_Replace((PyObject *)self, return PyUnicode_Replace((PyObject *)self,
from, to, count); from, to, count);
else if (PyObject_AsCharBuffer(from, &from_s, &from_len)) else if (PyObject_AsCharBuffer(from, &from_s, &from_len))