summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakthipriyan Vairamani (thefourtheye) <thechargingvolcano@gmail.com>2018-10-18 10:29:07 +0530
committerJames M Snell <jasnell@gmail.com>2018-10-21 12:25:06 -0700
commit77b3666b84f7aa5d264e5232b39ee6f9f99d1cfc (patch)
tree4c0eb2e08c44b51ce5e8af6e510ac530eb68078c
parenta6124892ff3039c06124214dfb93370bebc965e9 (diff)
downloadnode-new-77b3666b84f7aa5d264e5232b39ee6f9f99d1cfc.tar.gz
tools: prefer filter to remove empty strings
Ref: https://github.com/nodejs/node/pull/23585#issuecomment-430585490 Python's `list.remove` will throw if the element is not found and also it removes only the first occurrence. This patch replaces the use of `list.remove` with a `filter` which solves both of the above mentioned problems. PR-URL: https://github.com/nodejs/node/pull/23727 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rwxr-xr-xtools/test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/test.py b/tools/test.py
index 0571f3394b..3d0ba43bec 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -1381,8 +1381,8 @@ def ProcessOptions(options):
options.arch = options.arch.split(',')
options.mode = options.mode.split(',')
options.run = options.run.split(',')
- options.skip_tests = options.skip_tests.split(',')
- options.skip_tests.remove("")
+ # Split at commas and filter out all the empty strings.
+ options.skip_tests = filter(bool, options.skip_tests.split(','))
if options.run == [""]:
options.run = None
elif len(options.run) != 2: