From 7062db8a999e00fe6449b1f620801b5a857117b7 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 22 Apr 2010 13:30:10 +0000 Subject: [PATCH] Issue #8496: make mailcap.lookup() always return a list, rather than an iterator. Patch by Gregory Nofi. --- Lib/mailcap.py | 2 +- Misc/NEWS | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/mailcap.py b/Lib/mailcap.py index bc93026dcd..4ae13d7ed7 100644 --- a/Lib/mailcap.py +++ b/Lib/mailcap.py @@ -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=[]): diff --git a/Misc/NEWS b/Misc/NEWS index 4697370bd2..a305a0d176 100644 --- 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. -- 2.40.0