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

Restore single return

parent fdee8026
...@@ -2071,16 +2071,18 @@ def find_on_path(importer, path_item, only=False): ...@@ -2071,16 +2071,18 @@ def find_on_path(importer, path_item, only=False):
def dist_factory(path_item, entry, only): def dist_factory(path_item, entry, only):
"""Return a dist_factory for the given entry.""" """Return a dist_factory for the given entry."""
lower = entry.lower() lower = entry.lower()
if lower.endswith('.egg-info'): is_egg_info = lower.endswith('.egg-info')
return distributions_from_metadata is_dist_info = lower.endswith('.dist-info') and os.path.isdir(entry)
elif lower.endswith('.dist-info') and os.path.isdir(entry): is_meta = is_egg_info or is_dist_info
return distributions_from_metadata return (
elif not only and _is_egg_path(entry): distributions_from_metadata
return find_distributions if is_meta else
elif not only and lower.endswith('.egg-link'): find_distributions
return resolve_egg_link if not only and _is_egg_path(entry) else
else: resolve_egg_link
return NoDists() if not only and lower.endswith('.egg-link') else
NoDists()
)
class NoDists: class NoDists:
......
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