diff options
author | Sakthipriyan Vairamani (thefourtheye) <thechargingvolcano@gmail.com> | 2019-01-19 15:37:54 +0530 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-01-23 05:45:31 +0100 |
commit | 907ff0a47d4e0fec66f85d204a93cd29d40103e5 (patch) | |
tree | 1a95f36e56a7da828106e74de3c139bf5b08305d /tools | |
parent | ef1c639db562f103a66fb5c09e098540347c599f (diff) | |
download | android-node-v8-907ff0a47d4e0fec66f85d204a93cd29d40103e5.tar.gz android-node-v8-907ff0a47d4e0fec66f85d204a93cd29d40103e5.tar.bz2 android-node-v8-907ff0a47d4e0fec66f85d204a93cd29d40103e5.zip |
build: make install.py python 3 compatiable
This patch replaces usage of `filter` in such a way that it will be
compatible with Python 3. Also, this patch replaces the usage of `map`
to do a side-effect work with normal `for` loop.
PR-URL: https://github.com/nodejs/node/pull/25583
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/install.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/install.py b/tools/install.py index 659b3b23a9..3befec213b 100755 --- a/tools/install.py +++ b/tools/install.py @@ -72,8 +72,13 @@ def try_remove(path, dst): try_unlink(target_path) try_rmdir_r(os.path.dirname(target_path)) -def install(paths, dst): map(lambda path: try_copy(path, dst), paths) -def uninstall(paths, dst): map(lambda path: try_remove(path, dst), paths) +def install(paths, dst): + for path in paths: + try_copy(path, dst) + +def uninstall(paths, dst): + for path in paths: + try_remove(path, dst) def npm_files(action): target_path = 'lib/node_modules/npm/' @@ -85,7 +90,7 @@ def npm_files(action): # npm has a *lot* of files and it'd be a pain to maintain a fixed list here # so we walk its source directory instead... for dirname, subdirs, basenames in os.walk('deps/npm', topdown=True): - subdirs[:] = filter('test'.__ne__, subdirs) # skip test suites + subdirs[:] = [subdir for subdir in subdirs if subdir != 'test'] paths = [os.path.join(dirname, basename) for basename in basenames] action(paths, target_path + dirname[9:] + '/') @@ -162,7 +167,7 @@ def headers(action): 'deps/v8/include/v8-inspector.h', 'deps/v8/include/v8-inspector-protocol.h' ] - files = filter(lambda name: name not in inspector_headers, files) + files = [name for name in files if name not in inspector_headers] action(files, dest) action([ |