summaryrefslogtreecommitdiff
path: root/pkg_resources/__init__.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-09-09 11:43:27 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-09-09 11:43:27 -0400
commit5df09426c3cfae75257849dcc505f4258217bf62 (patch)
treeb9836b16d0bce8b854ae515c8d137590871ec88f /pkg_resources/__init__.py
parenta95cd91de2c314640fdd5466a67c44f1642f9803 (diff)
downloadpython-setuptools-git-5df09426c3cfae75257849dcc505f4258217bf62.tar.gz
Extract variable for is_meta
Diffstat (limited to 'pkg_resources/__init__.py')
-rw-r--r--pkg_resources/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 87568c2e..d9664adc 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2049,10 +2049,10 @@ def find_on_path(importer, path_item, only=False):
for entry in path_item_entries:
lower = entry.lower()
fullpath = os.path.join(path_item, entry)
+ is_meta = any(map(lower.endswith, ('.egg-info', '.dist-info')))
dists = (
distributions_from_metadata(fullpath)
- if lower.endswith('.egg-info')
- or lower.endswith('.dist-info') else
+ if is_meta else
find_distributions(fullpath)
if not only and _is_egg_path(entry) else
resolve_egg_link(fullpath)