Commit ae9709b3 authored by Jason R. Coombs's avatar Jason R. Coombs

Use filter

parent 7d34b2d7
......@@ -2693,20 +2693,19 @@ class Distribution(object):
environment markers and filter out any dependencies
not matching the markers.
"""
for extra in list(dm):
if extra:
new_extra = extra
reqs = dm.pop(extra)
if ':' in extra:
new_extra, marker = extra.split(':', 1)
if invalid_marker(marker):
# XXX warn
reqs = []
elif not evaluate_marker(marker):
reqs = []
new_extra = safe_extra(new_extra) or None
dm.setdefault(new_extra, []).extend(reqs)
for extra in list(filter(None, dm)):
new_extra = extra
reqs = dm.pop(extra)
if ':' in extra:
new_extra, marker = extra.split(':', 1)
if invalid_marker(marker):
# XXX warn
reqs = []
elif not evaluate_marker(marker):
reqs = []
new_extra = safe_extra(new_extra) or None
dm.setdefault(new_extra, []).extend(reqs)
return dm
def _build_dep_map(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment