From 7b5f8e131cdce8626c138f8815f9001214dc2541 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 31 Dec 2020 17:54:56 +0100 Subject: Simplify `command.easy_install.expand_paths` --- setuptools/command/easy_install.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index df7b1d07..6882efe0 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1459,13 +1459,18 @@ def expand_paths(inputs): # Yield existing non-dupe, non-import directory lines from it for line in lines: - if not line.startswith("import"): - line = normalize_path(line.rstrip()) - if line not in seen: - seen[line] = 1 - if not os.path.isdir(line): - continue - yield line, os.listdir(line) + if line.startswith("import"): + continue + + line = normalize_path(line.rstrip()) + if line in seen: + continue + + seen[line] = 1 + if not os.path.isdir(line): + continue + + yield line, os.listdir(line) def extract_wininst_cfg(dist_filename): -- cgit v1.2.1