Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a4b309eb
Commit
a4b309eb
authored
Mar 13, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo in replace() detected by Mark Hammond and fixed by Marc-Andre.
parent
3d565a17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Objects/stringobject.c
Objects/stringobject.c
+4
-2
No files found.
Objects/stringobject.c
View file @
a4b309eb
...
...
@@ -389,7 +389,9 @@ PyObject *a, *el;
{
register
char
*
s
,
*
end
;
register
char
c
;
if
(
!
PyString_Check
(
el
)
||
PyString_Size
(
el
)
!=
1
)
{
if
(
!
PyString_Check
(
el
))
return
PyUnicode_Contains
(
a
,
el
);
if
(
PyString_Size
(
el
)
!=
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
"string member test needs char left operand"
);
return
-
1
;
...
...
@@ -1575,7 +1577,7 @@ string_replace(self, args)
else
if
(
PyObject_AsCharBuffer
(
replobj
,
&
repl
,
&
repl_len
))
return
NULL
;
if
(
repl
_len
<=
0
)
{
if
(
sub
_len
<=
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"empty replacement string"
);
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment