Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3c5f5c

Browse files
committed
After much hemming and hawing, we decided to roll back Fred's change.
It breaks Mailman, it was actually documented in the docstring, so it was an intentional deviation from the usual del semantics. Let's document the original behavior in Doc/lib/librfc822.tex.
1 parent 9376b74 commit f3c5f5c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/rfc822.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ def __setitem__(self, name, value):
397397

398398
def __delitem__(self, name):
399399
"""Delete all occurrences of a specific header, if it is present."""
400-
lowname = string.lower(name)
401-
if not self.dict.has_key(lowname):
402-
raise KeyError, name
403-
del self.dict[lowname]
404-
name = lowname + ':'
400+
name = string.lower(name)
401+
if not self.dict.has_key(name):
402+
return
403+
del self.dict[name]
404+
name = name + ':'
405405
n = len(name)
406406
list = []
407407
hit = 0

0 commit comments

Comments
 (0)