summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/rfc822.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 9093beb..14fd2a8 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -421,24 +421,23 @@ class Message:
for i in list:
del self.headers[i]
- def get(self, name, default=None):
+ def get(self, name, default=""):
name = name.lower()
if self.dict.has_key(name):
return self.dict[name]
else:
return default
- def setdefault(self, name, default=''):
+ def setdefault(self, name, default=""):
lowername = name.lower()
if self.dict.has_key(lowername):
return self.dict[lowername]
else:
- default = default or ""
- self.dict[lowername] = default
- text = "%s: %s" % (name, default)
+ text = name + ": " + default
lines = text.split("\n")
for line in lines:
self.headers.append(line + "\n")
+ self.dict[lowername] = default
return default
def has_key(self, name):