Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7062db8

Browse files
committed
Issue #8496: make mailcap.lookup() always return a list, rather than an iterator.
Patch by Gregory Nofi.
1 parent 945c17f commit 7062db8

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/mailcap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def lookup(caps, MIMEtype, key=None):
164164
if MIMEtype in caps:
165165
entries = entries + caps[MIMEtype]
166166
if key is not None:
167-
entries = filter(lambda e, key=key: key in e, entries)
167+
entries = [e for e in entries if key in e]
168168
return entries
169169

170170
def subst(field, MIMEtype, filename, plist=[]):

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ C-API
326326
Library
327327
-------
328328

329+
- Issue #8496: make mailcap.lookup() always return a list, rather than an
330+
iterator. Patch by Gregory Nofi.
331+
329332
- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
330333
collation name contains a surrogate character.
331334

0 commit comments

Comments
 (0)