Kaydet (Commit) 81ffe75d authored tarafından Fred Drake's avatar Fred Drake

Message.__delitem__(): If the key doesn't exist in the dictionary,

        raise KeyError instead of failing silently!
üst 75ae7e7d
......@@ -397,11 +397,11 @@ class Message:
def __delitem__(self, name):
"""Delete all occurrences of a specific header, if it is present."""
name = string.lower(name)
if not self.dict.has_key(name):
return
del self.dict[name]
name = name + ':'
lowname = string.lower(name)
if not self.dict.has_key(lowname):
raise KeyError, name
del self.dict[lowname]
name = lowname + ':'
n = len(name)
list = []
hit = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment