summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-19 15:28:37 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-19 15:28:37 (GMT)
commit49061f7b8f8c0e5ca123a545447781e10a3b77d9 (patch)
tree5baed2fb8165bbff61128f80940ebe2242742017 /Lib/email
parent1b01e5c706a1fd2bef24ec3e67c41b16423bcd7b (diff)
downloadcpython-49061f7b8f8c0e5ca123a545447781e10a3b77d9.zip
cpython-49061f7b8f8c0e5ca123a545447781e10a3b77d9.tar.gz
cpython-49061f7b8f8c0e5ca123a545447781e10a3b77d9.tar.bz2
Stomp out more hsa_key() calls.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/_parseaddr.py2
-rw-r--r--Lib/email/message.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py
index a08c43e..8047df2 100644
--- a/Lib/email/_parseaddr.py
+++ b/Lib/email/_parseaddr.py
@@ -109,7 +109,7 @@ def parsedate_tz(data):
return None
tzoffset = None
tz = tz.upper()
- if _timezones.has_key(tz):
+ if tz in _timezones:
tzoffset = _timezones[tz]
else:
try:
diff --git a/Lib/email/message.py b/Lib/email/message.py
index 79c5c4c..6110131 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -245,16 +245,16 @@ class Message:
# BAW: should we accept strings that can serve as arguments to the
# Charset constructor?
self._charset = charset
- if not self.has_key('MIME-Version'):
+ if 'MIME-Version' not in self:
self.add_header('MIME-Version', '1.0')
- if not self.has_key('Content-Type'):
+ if 'Content-Type' not in self:
self.add_header('Content-Type', 'text/plain',
charset=charset.get_output_charset())
else:
self.set_param('charset', charset.get_output_charset())
if str(charset) <> charset.get_output_charset():
self._payload = charset.body_encode(self._payload)
- if not self.has_key('Content-Transfer-Encoding'):
+ if 'Content-Transfer-Encoding' not in self:
cte = charset.get_body_encoding()
try:
cte(self)
@@ -547,7 +547,7 @@ class Message:
VALUE item in the 3-tuple) is always unquoted, unless unquote is set
to False.
"""
- if not self.has_key(header):
+ if header not in self:
return failobj
for k, v in self._get_params_preserve(failobj, header):
if k.lower() == param.lower():
@@ -578,7 +578,7 @@ class Message:
if not isinstance(value, tuple) and charset:
value = (charset, language, value)
- if not self.has_key(header) and header.lower() == 'content-type':
+ if header not in self and header.lower() == 'content-type':
ctype = 'text/plain'
else:
ctype = self.get(header)
@@ -613,7 +613,7 @@ class Message:
False. Optional header specifies an alternative to the Content-Type
header.
"""
- if not self.has_key(header):
+ if header not in self:
return
new_ctype = ''
for p, v in self.get_params(header=header, unquote=requote):
@@ -649,7 +649,7 @@ class Message:
if header.lower() == 'content-type':
del self['mime-version']
self['MIME-Version'] = '1.0'
- if not self.has_key(header):
+ if header not in self:
self[header] = type
return
params = self.get_params(header=header, unquote=requote)