SF 563203. Replaced 'has_key()' with 'in'.

This commit is contained in:
Raymond Hettinger 2002-06-01 14:18:47 +00:00
parent 9d5e4aa414
commit 54f0222547
54 changed files with 243 additions and 222 deletions

View file

@ -549,7 +549,7 @@ class HTTPConnection:
# If headers already contains a host header, then define the
# optional skip_host argument to putrequest(). The check is
# harder because field names are case insensitive.
if (headers.has_key('Host')
if 'Host' in (headers
or [k for k in headers.iterkeys() if k.lower() == "host"]):
self.putrequest(method, url, skip_host=1)
else: