mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +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
|
@ -348,7 +348,7 @@ class HTTPResponse:
|
|||
# An HTTP/1.1 proxy is assumed to stay open unless
|
||||
# explicitly closed.
|
||||
conn = self.msg.getheader('connection')
|
||||
if conn and conn.lower().find("close") >= 0:
|
||||
if conn and "close" in conn.lower():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -361,7 +361,7 @@ class HTTPResponse:
|
|||
|
||||
# Proxy-Connection is a netscape hack.
|
||||
pconn = self.msg.getheader('proxy-connection')
|
||||
if pconn and pconn.lower().find("keep-alive") >= 0:
|
||||
if pconn and "keep-alive" in pconn.lower():
|
||||
return False
|
||||
|
||||
# otherwise, assume it will close
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue