summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-10-09 15:48:29 (GMT)
committerBarry Warsaw <barry@python.org>2001-10-09 15:48:29 (GMT)
commit9300a75c88942ac0dce42db74ffb3b2916bbc64f (patch)
treea567831d5f993a3558de6146ddd994fd7d9e5400
parent93a6327adff7274cbfb47f3b8c73970f0605e787 (diff)
downloadcpython-9300a75c88942ac0dce42db74ffb3b2916bbc64f.zip
cpython-9300a75c88942ac0dce42db74ffb3b2916bbc64f.tar.gz
cpython-9300a75c88942ac0dce42db74ffb3b2916bbc64f.tar.bz2
get_all(): We never returned failobj if we found no matching headers.
Fix that, and also make the docstring describe failobj.
-rw-r--r--Lib/email/Message.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/email/Message.py b/Lib/email/Message.py
index 512a0e9..00efbcc 100644
--- a/Lib/email/Message.py
+++ b/Lib/email/Message.py
@@ -227,12 +227,16 @@ class Message:
These will be sorted in the order they appeared in the original
message, and may contain duplicates. Any fields deleted and
re-inserted are alwyas appended to the header list.
+
+ If no such fields exist, failobj is returned (defaults to None).
"""
values = []
name = name.lower()
for k, v in self._headers:
if k.lower() == name:
values.append(v)
+ if not values:
+ return failobj
return values
def add_header(self, _name, _value, **_params):