diff --git a/util/bot/DEPS b/util/bot/DEPS index bad720fb6..46f484f19 100644 --- a/util/bot/DEPS +++ b/util/bot/DEPS @@ -127,7 +127,7 @@ hooks = [ 'name': 'cmake_win32_extract', 'pattern': '.', 'condition': 'host_os == "win"', - 'action': [ 'python', + 'action': [ 'python3', 'boringssl/util/bot/extract.py', 'boringssl/util/bot/cmake-win32.zip', 'boringssl/util/bot/cmake-win32/', @@ -149,7 +149,7 @@ hooks = [ 'name': 'perl_win32_extract', 'pattern': '.', 'condition': 'host_os == "win"', - 'action': [ 'python', + 'action': [ 'python3', 'boringssl/util/bot/extract.py', '--no-prefix', 'boringssl/util/bot/perl-win32.zip', @@ -172,7 +172,7 @@ hooks = [ 'name': 'win_toolchain', 'pattern': '.', 'condition': 'host_os == "win"', - 'action': [ 'python', + 'action': [ 'python3', 'boringssl/util/bot/vs_toolchain.py', 'update', Var('vs_version'), @@ -182,7 +182,7 @@ hooks = [ 'name': 'clang', 'pattern': '.', 'condition': 'checkout_clang', - 'action': [ 'python', + 'action': [ 'python3', 'boringssl/util/bot/update_clang.py', ], }, @@ -200,7 +200,7 @@ hooks = [ 'name': 'sde_linux64_extract', 'pattern': '.', 'condition': 'checkout_sde and host_os == "linux"', - 'action': [ 'python', + 'action': [ 'python3', 'boringssl/util/bot/extract.py', 'boringssl/util/bot/sde-linux64.tar.bz2', 'boringssl/util/bot/sde-linux64/', @@ -220,7 +220,7 @@ hooks = [ 'name': 'sde_win32_extract', 'pattern': '.', 'condition': 'checkout_sde and host_os == "win"', - 'action': [ 'python', + 'action': [ 'python3', 'boringssl/util/bot/extract.py', 'boringssl/util/bot/sde-win32.tar.bz2', 'boringssl/util/bot/sde-win32/', diff --git a/util/bot/extract.py b/util/bot/extract.py index 4680cfe3c..9b1b88a22 100644 --- a/util/bot/extract.py +++ b/util/bot/extract.py @@ -96,7 +96,7 @@ def main(args): # Skip archives that weren't downloaded. return 0 - with open(archive) as f: + with open(archive, 'rb') as f: sha256 = hashlib.sha256() while True: chunk = f.read(1024 * 1024) @@ -109,7 +109,7 @@ def main(args): if os.path.exists(stamp_path): with open(stamp_path) as f: if f.read().strip() == digest: - print "Already up-to-date." + print("Already up-to-date.") return 0 if archive.endswith('.zip'): @@ -123,10 +123,10 @@ def main(args): try: if os.path.exists(output): - print "Removing %s" % (output, ) + print("Removing %s" % (output, )) shutil.rmtree(output) - print "Extracting %s to %s" % (archive, output) + print("Extracting %s to %s" % (archive, output)) prefix = None num_extracted = 0 for entry in entries: @@ -166,14 +166,14 @@ def main(args): # Print every 100 files, so bots do not time out on large archives. num_extracted += 1 if num_extracted % 100 == 0: - print "Extracted %d files..." % (num_extracted,) + print("Extracted %d files..." % (num_extracted,)) finally: entries.close() with open(stamp_path, 'w') as f: f.write(digest) - print "Done. Extracted %d files." % (num_extracted,) + print("Done. Extracted %d files." % (num_extracted,)) return 0