summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-05-04 09:21:43 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-05-04 09:21:43 (GMT)
commitbac788a3cd348203a5fdabba52e5faf65bf35c5e (patch)
tree3c5bfe8295936ad51df617ef0fd053ebac684357 /Lib/httplib.py
parentc5e378da41641d5bc1e9b5c6c11bd470ff90b3e3 (diff)
downloadcpython-bac788a3cd348203a5fdabba52e5faf65bf35c5e.zip
cpython-bac788a3cd348203a5fdabba52e5faf65bf35c5e.tar.gz
cpython-bac788a3cd348203a5fdabba52e5faf65bf35c5e.tar.bz2
Replace str.find()!=1 with the more readable "in" operator.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index a23caf5..40e78b0 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -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