mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
str.replace(a, a) is now returning str unchanged if a is a
This commit is contained in:
parent
72ca65dce4
commit
59de0ee9e0
2 changed files with 8 additions and 0 deletions
|
@ -9604,6 +9604,8 @@ replace(PyObject *self, PyObject *str1,
|
|||
else if (maxcount == 0 || slen == 0)
|
||||
goto nothing;
|
||||
|
||||
if (str1 == str2)
|
||||
goto nothing;
|
||||
if (skind < kind1)
|
||||
/* substring too wide to be present */
|
||||
goto nothing;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue