Skip to content

Commit 77b3666

Browse files
thefourtheyejasnell
authored andcommittedOct 21, 2018
tools: prefer filter to remove empty strings
Ref: #23585 (comment) 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: #23727 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a612489 commit 77b3666

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎tools/test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1381,8 +1381,8 @@ def ProcessOptions(options):
13811381
options.arch = options.arch.split(',')
13821382
options.mode = options.mode.split(',')
13831383
options.run = options.run.split(',')
1384-
options.skip_tests = options.skip_tests.split(',')
1385-
options.skip_tests.remove("")
1384+
# Split at commas and filter out all the empty strings.
1385+
options.skip_tests = filter(bool, options.skip_tests.split(','))
13861386
if options.run == [""]:
13871387
options.run = None
13881388
elif len(options.run) != 2:

0 commit comments

Comments
 (0)