mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +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
|
@ -554,7 +554,7 @@ class ConfigParser(RawConfigParser):
|
|||
depth = MAX_INTERPOLATION_DEPTH
|
||||
while depth: # Loop through this until it's done
|
||||
depth -= 1
|
||||
if value.find("%(") != -1:
|
||||
if "%(" in value:
|
||||
try:
|
||||
value = value % vars
|
||||
except KeyError, e:
|
||||
|
@ -562,7 +562,7 @@ class ConfigParser(RawConfigParser):
|
|||
option, section, rawval, e[0])
|
||||
else:
|
||||
break
|
||||
if value.find("%(") != -1:
|
||||
if "%(" in value:
|
||||
raise InterpolationDepthError(option, section, rawval)
|
||||
return value
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue