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.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
cc @refack @rvagg @nodejs/python