]> granicus.if.org Git - python/commitdiff
Issue #8496: make mailcap.lookup() always return a list, rather than an iterator.
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 22 Apr 2010 13:30:10 +0000 (13:30 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 22 Apr 2010 13:30:10 +0000 (13:30 +0000)
Patch by Gregory Nofi.

Lib/mailcap.py
Misc/NEWS

index bc93026dcde38147cb052cb796e8c835a54ff73e..4ae13d7ed7fb89bd93912aaee54ea47b8b18f699 100644 (file)
@@ -164,7 +164,7 @@ def lookup(caps, MIMEtype, key=None):
     if MIMEtype in caps:
         entries = entries + caps[MIMEtype]
     if key is not None:
-        entries = filter(lambda e, key=key: key in e, entries)
+        entries = [e for e in entries if key in e]
     return entries
 
 def subst(field, MIMEtype, filename, plist=[]):
index 4697370bd222cbc6ea500275b4a8426d03829095..a305a0d1764e5c7b4f9d050ba306c4bf94edf4fd 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -326,6 +326,9 @@ C-API
 Library
 -------
 
+- Issue #8496: make mailcap.lookup() always return a list, rather than an
+  iterator.  Patch by Gregory Nofi.
+
 - Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
   collation name contains a surrogate character.