mirror of https://github.com/python/cpython
Issue #8496: make mailcap.lookup() always return a list, rather than an iterator.
Patch by Gregory Nofi.
This commit is contained in:
parent
945c17f5ec
commit
7062db8a99
|
@ -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=[]):
|
||||
|
|
Loading…
Reference in New Issue