]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
After much hemming and hawing, we decided to roll back Fred's change.
authorGuido van Rossum <guido@python.org>
Wed, 15 Sep 1999 22:15:23 +0000 (22:15 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 15 Sep 1999 22:15:23 +0000 (22:15 +0000)
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.

Lib/rfc822.py

index dcf059c85a3dbdbbfecb3a9802dab9945153a4ea..87219949c322ef4715ce1408ad90660e5ca70eb9 100644 (file)
@@ -397,11 +397,11 @@ class Message:
     
     def __delitem__(self, name):
         """Delete all occurrences of a specific header, if it is present."""
-        lowname = string.lower(name)
-        if not self.dict.has_key(lowname):
-            raise KeyError, name
-        del self.dict[lowname]
-        name = lowname + ':'
+        name = string.lower(name)
+        if not self.dict.has_key(name):
+            return
+        del self.dict[name]
+        name = name + ':'
         n = len(name)
         list = []
         hit = 0