From 7c91220e437cda65d1ced0d03972a234e76bde4b Mon Sep 17 00:00:00 2001 From: Pham Sy Minh <59408894+shelld3v@users.noreply.github.com> Date: Thu, 4 Jan 2024 00:25:15 +0700 Subject: [PATCH] Fix #1350 --- lib/core/options.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/core/options.py b/lib/core/options.py index 37275f2d9..c28dfd1f1 100755 --- a/lib/core/options.py +++ b/lib/core/options.py @@ -120,17 +120,23 @@ def parse_options(): opt.skip_on_status = _parse_status_codes(opt.skip_on_status) opt.prefixes = tuple(strip_and_uniquify(opt.prefixes.split(","))) opt.suffixes = tuple(strip_and_uniquify(opt.suffixes.split(","))) - opt.subdirs = strip_and_uniquify( - [ - subdir.lstrip("/") + ("" if not subdir or subdir.endswith("/") else "/") - for subdir in opt.subdirs.split(",") - ] + opt.subdirs = map( + lambda subdir: subdir.lstrip("/"), + strip_and_uniquify( + [ + subdir if subdir.endswith("/") else subdir + "/" + for subdir in opt.subdirs.split(",") + ] + ), ) - opt.exclude_subdirs = strip_and_uniquify( - [ - subdir.lstrip("/") + ("" if not subdir or subdir.endswith("/") else "/") - for subdir in opt.exclude_subdirs.split(",") - ] + opt.exclude_subdirs = map( + lambda subdir: subdir.lstrip("/"), + strip_and_uniquify( + [ + subdir if subdir.endswith("/") else subdir + "/" + for subdir in opt.exclude_subdirs.split(",") + ] + ), ) opt.exclude_sizes = {size.strip().upper() for size in opt.exclude_sizes.split(",")}