Commit 9755c3bc authored by Jason R. Coombs's avatar Jason R. Coombs

Rewrite loop as single generator expression.

parent e0433cf3
...@@ -645,13 +645,12 @@ class WorkingSet: ...@@ -645,13 +645,12 @@ class WorkingSet:
distributions in the working set, otherwise only ones matching distributions in the working set, otherwise only ones matching
both `group` and `name` are yielded (in distribution order). both `group` and `name` are yielded (in distribution order).
""" """
for dist in self: return (
entries = dist.get_entry_map(group) entry
if name is None: for dist in self
for ep in entries.values(): for entry in dist.get_entry_map(group).values()
yield ep if name is None or name == entry.name
elif name in entries: )
yield entries[name]
def run_script(self, requires, script_name): def run_script(self, requires, script_name):
"""Locate distribution for `requires` and run `script_name` script""" """Locate distribution for `requires` and run `script_name` script"""
......
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