• Daniel Dromboski's avatar
    [tools] More Python 3 compatibility fixes · 8807f0ad
    Daniel Dromboski authored
    These should all be forward/backward compatible with Python 2/Python 3.
    
    [tools] Tweak statusfile.py for Python 3
    
    .iteritems() does not exist in Python 3, only .items().
    
    (While .iteritems() was meant to be an optimization over .items()
    in Python 2, .items() should work fine, and it is forward/backward
    compatible.)
    
    
    [tools] Fix another Python 3 issue in mb.py
    
    sys.platform used to return e.g. 'linux2', which is 'linux' plus
    whatever the first digit of `uname -r` was when Python was built.
    As of Python 3.3, it always returns just 'linux' for Linux OSes.
    Use `sys.platform.startswith('linux')` for forward/backward
    compatibility.
    
    
    [tools] Make base_runner.py Python 3 compatible
    
    dict.keys() returns a dict_keys in Python 3, whereas it
    used to return a simple array. list() is forward/backward
    compatible with identical results on Python 2/3 (returns array).
    
    (Tested on Linux x64, trying to recreate NodeJS's CI workflow.)
    
    
    [tools] Make tools/dev/v8gen.py work with Python 3
    
    dict.keys() returns a dict_keys in Python 3, whereas it
    used to return a simple array. list() is forward/backward
    compatible with identical results on Python 2/3 (returns array).
    
    Comparing a None-type value numerically used to result in the
    None-type value always being considered "less than" the thing
    it is compared to. As of Python 3, numerically comparing against
    None or None-typed values results in an error. Check if a value
    is truthy before numerically comparing it, for forward/backward
    compatibility.
    
    print() used to transparently decode byte strings in Python 2.
    In Python 3, they must be explicitly decoded first.
    
    (Tested on Linux 64-bit, trying to recreate NodeJS's CI workflow.)
    
    Bug: v8:9871
    Change-Id: I059bf98577a67649bbe7ec49848989d468da96b0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2867270Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
    Commit-Queue: Michael Achenbach <machenbach@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74369}
    8807f0ad
Name
Last commit
Last update
.github Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
RISCV_OWNERS Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...