]> granicus.if.org Git - python/commitdiff
Message.getheaders(): If there are no matching headers, return an
authorFred Drake <fdrake@acm.org>
Mon, 14 Jun 1999 15:40:23 +0000 (15:40 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 14 Jun 1999 15:40:23 +0000 (15:40 +0000)
       empty list instead of None.  (Guido's request.)

Lib/rfc822.py

index ef5a8512f06c7ae1f8d94a5c798877fb02f582bb..96a02d1c2b7ab89a56e5382d2d3b5f9a4a46423d 100644 (file)
@@ -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.