]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Typo in bytes.replace(): the buffer interface was always used.
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Thu, 22 Nov 2007 02:55:35 +0000 (02:55 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Thu, 22 Nov 2007 02:55:35 +0000 (02:55 +0000)
Objects/stringobject.c

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