summaryrefslogtreecommitdiff
path: root/paste/util
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-21 12:04:16 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-04-21 12:04:16 +0200
commitb805be8dfd7828b846b04b6a03405b71cfceb50a (patch)
treeb87098c47bb08b136ec70be9e849c108a445ab26 /paste/util
parent87f53c983e7b94ed1d8389f97c605c6afe5b1c57 (diff)
downloadpaste-b805be8dfd7828b846b04b6a03405b71cfceb50a.tar.gz
Fix best_match() and desired_matches() on py3
Diffstat (limited to 'paste/util')
-rw-r--r--paste/util/mimeparse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/util/mimeparse.py b/paste/util/mimeparse.py
index fe699f7..b796c8b 100644
--- a/paste/util/mimeparse.py
+++ b/paste/util/mimeparse.py
@@ -132,7 +132,7 @@ def best_match(supported, header):
"""
if not supported:
return ''
- parsed_header = map(parse_media_range, header.split(','))
+ parsed_header = list(map(parse_media_range, header.split(',')))
best_type = max([
(fitness_and_quality_parsed(mime_type, parsed_header), -n)
for n, mime_type in enumerate(supported)])
@@ -154,7 +154,7 @@ def desired_matches(desired, header):
>>> desired_matches(['text/html', 'application/xml'], 'application/xml,application/json')
['application/xml']
"""
- parsed_ranges = map(parse_media_range, header.split(','))
+ parsed_ranges = list(map(parse_media_range, header.split(',')))
return [mimetype for mimetype in desired
if quality_parsed(mimetype, parsed_ranges)]