Make make.py python3 compatible

This commit is contained in:
Adrian Heine 2020-05-11 21:53:51 +02:00 committed by Rick Waldron
parent 35a31d157b
commit dd848d4c9d
1 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@
# Copyright (C) 2016 the V8 project authors. All rights reserved. # Copyright (C) 2016 the V8 project authors. All rights reserved.
# This code is governed by the BSD license found in the LICENSE file. # This code is governed by the BSD license found in the LICENSE file.
from __future__ import print_function
import os, shutil, subprocess, sys import os, shutil, subprocess, sys
OUT_DIR = os.environ.get('OUT_DIR') or 'test' OUT_DIR = os.environ.get('OUT_DIR') or 'test'
@ -10,10 +11,10 @@ UPSTREAM = os.environ.get('UPSTREAM') or 'git@github.com:tc39/test262.git'
MAINTAINER = os.environ.get('MAINTAINER') or 'test262@ecma-international.org' MAINTAINER = os.environ.get('MAINTAINER') or 'test262@ecma-international.org'
def shell(*args): def shell(*args):
sp = subprocess.Popen(list(args), stdout=subprocess.PIPE) sp = subprocess.Popen(list(args), stdout=subprocess.PIPE, universal_newlines=True)
cmd_str = ' '.join(args) cmd_str = ' '.join(args)
print '> ' + cmd_str print('> ' + cmd_str)
for line in iter(sp.stdout.readline, ''): for line in iter(sp.stdout.readline, ''):
sys.stdout.write(line) sys.stdout.write(line)
@ -27,7 +28,7 @@ targets = dict()
def target(*deps): def target(*deps):
def other(orig): def other(orig):
def wrapped(): def wrapped():
print 'Running target: ' + orig.__name__ print('Running target: ' + orig.__name__)
for dep in deps: for dep in deps:
targets[dep]() targets[dep]()