mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Replace str.find()!=1 with the more readable "in" operator.
This commit is contained in:
parent
c5e378da41
commit
bac788a3cd
7 changed files with 9 additions and 9 deletions
|
@ -250,7 +250,7 @@ class TimeRE(dict):
|
|||
format = regex_chars.sub(r"\\\1", format)
|
||||
whitespace_replacement = re_compile('\s+')
|
||||
format = whitespace_replacement.sub('\s*', format)
|
||||
while format.find('%') != -1:
|
||||
while '%' in format:
|
||||
directive_index = format.index('%')+1
|
||||
processed_format = "%s%s%s" % (processed_format,
|
||||
format[:directive_index-1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue