diff options
author | Sakthipriyan Vairamani (thefourtheye) <thechargingvolcano@gmail.com> | 2019-01-19 15:14:47 +0530 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-01-28 08:55:11 +0100 |
commit | 26f80dcddd441c064df82d5caddfdcafbd36350f (patch) | |
tree | 7da8ab04df0487327914817c65ed38de4e7baaf2 /configure.py | |
parent | 1d6079432138ed269aa9bc208dc3f53022057b71 (diff) | |
download | android-node-v8-26f80dcddd441c064df82d5caddfdcafbd36350f.tar.gz android-node-v8-26f80dcddd441c064df82d5caddfdcafbd36350f.tar.bz2 android-node-v8-26f80dcddd441c064df82d5caddfdcafbd36350f.zip |
build: make configure.py compatible with python 3
This patch replaces the following
1. Usage of `filter` with `None` to remove falsy items.
2. Usage of `map` to create lists. (Replaced with List comprehensions).
3. Dictionary's `iteritems` which is removed in Python 3.
PR-URL: https://github.com/nodejs/node/pull/25580
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.py b/configure.py index aa104b298d..5a7cade60c 100755 --- a/configure.py +++ b/configure.py @@ -1139,8 +1139,8 @@ def configure_library(lib, output): if options.__dict__[shared_lib + '_includes']: output['include_dirs'] += [options.__dict__[shared_lib + '_includes']] elif pkg_cflags: - output['include_dirs'] += ( - filter(None, map(str.strip, pkg_cflags.split('-I')))) + stripped_flags = [flag.strip() for flag in pkg_cflags.split('-I')] + output['include_dirs'] += [flag for flag in stripped_flags if flag] # libpath needs to be provided ahead libraries if options.__dict__[shared_lib + '_libpath']: @@ -1156,7 +1156,7 @@ def configure_library(lib, output): output['libraries'] += [pkg_libpath] default_libs = getattr(options, shared_lib + '_libname') - default_libs = map('-l{0}'.format, default_libs.split(',')) + default_libs = ['-l{0}'.format(lib) for lib in default_libs.split(',')] if default_libs: output['libraries'] += default_libs @@ -1382,7 +1382,8 @@ def configure_intl(o): # safe to split, cannot contain spaces o['libraries'] += libs.split() if cflags: - o['include_dirs'] += filter(None, map(str.strip, cflags.split('-I'))) + stripped_flags = [flag.strip() for flag in cflags.split('-I')] + o['include_dirs'] += [flag for flag in stripped_flags if flag] # use the "system" .gyp o['variables']['icu_gyp_path'] = 'tools/icu/icu-system.gyp' return @@ -1663,7 +1664,7 @@ config = { if options.prefix: config['PREFIX'] = options.prefix -config = '\n'.join(map('='.join, config.iteritems())) + '\n' +config = '\n'.join(['='.join(item) for item in config.items()]) + '\n' # On Windows there's no reason to search for a different python binary. bin_override = None if sys.platform == 'win32' else make_bin_override() |