diff options
author | Fred Drake <fdrake@acm.org> | 1999-06-14 15:40:23 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-06-14 15:40:23 (GMT) |
commit | cbfa5cbcc84af09d00bd013a6a896c7c864d8ee1 (patch) | |
tree | 0581fe1f5e4ef0f746846059ba94637eeda94239 /Lib | |
parent | 7df4dd7de2354ba4675db3d6f4aaca7416969282 (diff) | |
download | cpython-cbfa5cbcc84af09d00bd013a6a896c7c864d8ee1.zip cpython-cbfa5cbcc84af09d00bd013a6a896c7c864d8ee1.tar.gz cpython-cbfa5cbcc84af09d00bd013a6a896c7c864d8ee1.tar.bz2 |
Message.getheaders(): If there are no matching headers, return an
empty list instead of None. (Guido's request.)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/rfc822.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py index ef5a851..96a02d1 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -288,7 +288,8 @@ class Message: This returns a list of values for headers given more than once; each value in the result list is stripped in the same way as the - result of getheader(). If the header is not given, return None. + result of getheader(). If the header is not given, return an + empty list. """ result = [] current = '' @@ -306,7 +307,7 @@ class Message: have_header = 1 if have_header: result.append(current) - return result or None + return result def getaddr(self, name): """Get a single address from a header, as a tuple. |