diff --git a/.travis.yml b/.travis.yml index f6dc47d82971..8263d0286adf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,9 @@ x-ccache-setup-steps: &ccache-setup-steps os: linux dist: xenial language: cpp +env: + global: + - PYTHON_VERSION="2.7.15" jobs: include: - stage: "Compile" @@ -20,7 +23,7 @@ jobs: - g++-6 install: *ccache-setup-steps script: - - pyenv global 2.7.15 + - pyenv global ${PYTHON_VERSION} - ./configure - make -j2 -C out V=1 v8 @@ -34,7 +37,7 @@ jobs: - g++-6 install: *ccache-setup-steps script: - - pyenv global 2.7.15 + - pyenv global ${PYTHON_VERSION} - ./configure - make -j2 V=1 - cp out/Release/node /home/travis/.ccache @@ -47,7 +50,7 @@ jobs: - mkdir -p out/Release - cp /home/travis/.ccache/node out/Release/node script: - - pyenv global 2.7.15 + - pyenv global ${PYTHON_VERSION} - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default - name: "Test C++ Suites" @@ -63,7 +66,7 @@ jobs: - cp /home/travis/.ccache/cctest out/Release/cctest - touch config.gypi script: - - pyenv global 2.7.15 + - pyenv global ${PYTHON_VERSION} - out/Release/cctest - make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api @@ -72,7 +75,7 @@ jobs: language: node_js node_js: "node" install: - - pyenv global 2.7.15 + - pyenv global ${PYTHON_VERSION} - make lint-py-build || true script: - NODE=$(which node) make lint lint-py diff --git a/LICENSE b/LICENSE index 1f2435a72258..fe7f7b1c8868 100644 --- a/LICENSE +++ b/LICENSE @@ -1506,4 +1506,4 @@ The externally maintained libraries used by Node.js are: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - """ + """ \ No newline at end of file diff --git a/configure.py b/configure.py index 6a0bfd08609c..ad62925c86df 100755 --- a/configure.py +++ b/configure.py @@ -11,7 +11,6 @@ import shlex import subprocess import shutil -import string from distutils.spawn import find_executable as which # If not run from node/, cd to node/. @@ -675,8 +674,8 @@ def try_check_compiler(cc, lang): except OSError: return (False, False, '', '') - proc.stdin.write('__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ ' - '__clang_major__ __clang_minor__ __clang_patchlevel__') + proc.stdin.write(b'__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ ' + b'__clang_major__ __clang_minor__ __clang_patchlevel__') values = (proc.communicate()[0].split() + ['0'] * 7)[0:7] is_clang = values[0] == '1' @@ -753,7 +752,7 @@ def get_gas_version(cc): consider adjusting the CC environment variable if you installed it in a non-standard prefix.''') - gas_ret = proc.communicate()[1] + gas_ret = str(proc.communicate()[1]) match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret) if match: @@ -818,7 +817,7 @@ def cc_macros(cc=None): consider adjusting the CC environment variable if you installed it in a non-standard prefix.''') - p.stdin.write('\n') + p.stdin.write(b'\n') out = p.communicate()[0] out = str(out).split('\n') @@ -1311,7 +1310,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir): def configure_intl(o): def icu_download(path): - depFile = 'tools/icu/current_ver.dep'; + depFile = 'tools/icu/current_ver.dep' with open(depFile) as f: icus = json.load(f) # download ICU, if needed @@ -1380,7 +1379,7 @@ def write_config(data, name): o['variables']['icu_small'] = b(True) locs = set(options.with_icu_locales.split(',')) locs.add('root') # must have root - o['variables']['icu_locales'] = string.join(locs,',') + o['variables']['icu_locales'] = ','.join(str(loc) for loc in locs) # We will check a bit later if we can use the canned deps/icu-small elif with_intl == 'full-icu': # full ICU @@ -1520,7 +1519,7 @@ def write_config(data, name): elif int(icu_ver_major) < icu_versions['minimum_icu']: error('icu4c v%s.x is too old, v%d.x or later is required.' % (icu_ver_major, icu_versions['minimum_icu'])) - icu_endianness = sys.byteorder[0]; + icu_endianness = sys.byteorder[0] o['variables']['icu_ver_major'] = icu_ver_major o['variables']['icu_endianness'] = icu_endianness icu_data_file_l = 'icudt%s%s.dat' % (icu_ver_major, 'l') diff --git a/deps/v8/third_party/inspector_protocol/code_generator.py b/deps/v8/third_party/inspector_protocol/code_generator.py index 18777d0ff895..753bc5f825e6 100755 --- a/deps/v8/third_party/inspector_protocol/code_generator.py +++ b/deps/v8/third_party/inspector_protocol/code_generator.py @@ -62,15 +62,24 @@ def init_defaults(config_tuple, path, defaults): jinja_dir = arg_options.jinja_dir if not jinja_dir: raise Exception("jinja directory must be specified") - jinja_dir = jinja_dir.decode('utf8') + try: + jinja_dir = jinja_dir.decode('utf8') + except AttributeError: # Python 3 + pass output_base = arg_options.output_base if not output_base: raise Exception("Base output directory must be specified") - output_base = output_base.decode('utf8') + try: + output_base = output_base.decode('utf8') + except AttributeError: # Python 3 + pass config_file = arg_options.config if not config_file: raise Exception("Config file name must be specified") - config_file = config_file.decode('utf8') + try: + config_file = config_file.decode('utf8') + except AttributeError: # Python 3 + pass config_base = os.path.dirname(config_file) config_values = arg_options.config_value if not config_values: diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 48265b24185e..d66c07b4f0a7 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -636,9 +636,7 @@ def emit_config(): out.write('/* class type information */\n'); consts = []; - keys = typeclasses.keys(); - keys.sort(); - for typename in keys: + for typename in sorted(typeclasses): klass = typeclasses[typename]; consts.append({ 'name': 'type_%s__%s' % (klass, typename), @@ -649,9 +647,7 @@ def emit_config(): out.write('/* class hierarchy information */\n'); consts = []; - keys = klasses.keys(); - keys.sort(); - for klassname in keys: + for klassname in sorted(klasses): pklass = klasses[klassname]['parent']; bklass = get_base_class(klassname); if (bklass != 'Object'): diff --git a/tools/configure.d/nodedownload.py b/tools/configure.d/nodedownload.py index 53d2692ed15d..dfd79c995a6d 100644 --- a/tools/configure.d/nodedownload.py +++ b/tools/configure.d/nodedownload.py @@ -2,27 +2,30 @@ # Moved some utilities here from ../../configure from __future__ import print_function -import urllib import hashlib import sys import zipfile import tarfile -import fpformat import contextlib +try: + from urllib.request import FancyURLopener, URLopener +except ImportError: + from urllib import FancyURLopener, URLopener def formatSize(amt): """Format a size as a string in MB""" - return fpformat.fix(amt / 1024000., 1) + # return fpformat.fix(amt / 1024000., 1) + return "%.1f" % (amt / 1024000.) def spin(c): """print out an ASCII 'spinner' based on the value of counter 'c'""" spin = ".:|'" return (spin[c % len(spin)]) -class ConfigOpener(urllib.FancyURLopener): +class ConfigOpener(FancyURLopener): """fancy opener used by retrievefile. Set a UA""" # append to existing version (UA) - version = '%s node.js/configure' % urllib.URLopener.version + version = '%s node.js/configure' % URLopener.version def reporthook(count, size, total): """internal hook used by retrievefile"""