mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
replace has_key with 'in' operator
This commit is contained in:
parent
de0559998f
commit
6e3dbbdf39
29 changed files with 71 additions and 71 deletions
|
|
@ -160,7 +160,7 @@ class BaseHandler:
|
|||
|
||||
Subclasses can extend this to add other defaults.
|
||||
"""
|
||||
if not self.headers.has_key('Content-Length'):
|
||||
if 'Content-Length' not in self.headers:
|
||||
self.set_content_length()
|
||||
|
||||
def start_response(self, status, headers,exc_info=None):
|
||||
|
|
@ -195,11 +195,11 @@ class BaseHandler:
|
|||
if self.origin_server:
|
||||
if self.client_is_modern():
|
||||
self._write('HTTP/%s %s\r\n' % (self.http_version,self.status))
|
||||
if not self.headers.has_key('Date'):
|
||||
if 'Date' not in self.headers:
|
||||
self._write(
|
||||
'Date: %s\r\n' % format_date_time(time.time())
|
||||
)
|
||||
if self.server_software and not self.headers.has_key('Server'):
|
||||
if self.server_software and 'Server' not in self.headers:
|
||||
self._write('Server: %s\r\n' % self.server_software)
|
||||
else:
|
||||
self._write('Status: %s\r\n' % self.status)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue