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

Use filter

parent 7d34b2d7
...@@ -2693,20 +2693,19 @@ class Distribution(object): ...@@ -2693,20 +2693,19 @@ class Distribution(object):
environment markers and filter out any dependencies environment markers and filter out any dependencies
not matching the markers. not matching the markers.
""" """
for extra in list(dm): for extra in list(filter(None, dm)):
if extra: new_extra = extra
new_extra = extra reqs = dm.pop(extra)
reqs = dm.pop(extra) if ':' in extra:
if ':' in extra: new_extra, marker = extra.split(':', 1)
new_extra, marker = extra.split(':', 1) if invalid_marker(marker):
if invalid_marker(marker): # XXX warn
# XXX warn reqs = []
reqs = [] elif not evaluate_marker(marker):
elif not evaluate_marker(marker): reqs = []
reqs = [] new_extra = safe_extra(new_extra) or None
new_extra = safe_extra(new_extra) or None
dm.setdefault(new_extra, []).extend(reqs)
dm.setdefault(new_extra, []).extend(reqs)
return dm return dm
def _build_dep_map(self): 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