44# found in the LICENSE file.
55
66"""Argument-less script to select what to run on the buildbots."""
7+ from __future__ import print_function
78
89import os
910import shutil
@@ -24,25 +25,25 @@ def CallSubProcess(*args, **kwargs):
2425 with open (os .devnull ) as devnull_fd :
2526 retcode = subprocess .call (stdin = devnull_fd , * args , ** kwargs )
2627 if retcode != 0 :
27- print '@@@STEP_EXCEPTION@@@'
28+ print ( '@@@STEP_EXCEPTION@@@' )
2829 sys .exit (1 )
2930
3031
3132def PrepareCmake ():
3233 """Build CMake 2.8.8 since the version in Precise is 2.8.7."""
3334 if os .environ ['BUILDBOT_CLOBBER' ] == '1' :
34- print '@@@BUILD_STEP Clobber CMake checkout@@@'
35+ print ( '@@@BUILD_STEP Clobber CMake checkout@@@' )
3536 shutil .rmtree (CMAKE_DIR )
3637
3738 # We always build CMake 2.8.8, so no need to do anything
3839 # if the directory already exists.
3940 if os .path .isdir (CMAKE_DIR ):
4041 return
4142
42- print '@@@BUILD_STEP Initialize CMake checkout@@@'
43+ print ( '@@@BUILD_STEP Initialize CMake checkout@@@' )
4344 os .mkdir (CMAKE_DIR )
4445
45- print '@@@BUILD_STEP Sync CMake@@@'
46+ print ( '@@@BUILD_STEP Sync CMake@@@' )
4647 CallSubProcess (
4748 ['git' , 'clone' ,
4849 '--depth' , '1' ,
@@ -53,7 +54,7 @@ def PrepareCmake():
5354 CMAKE_DIR ],
5455 cwd = CMAKE_DIR )
5556
56- print '@@@BUILD_STEP Build CMake@@@'
57+ print ( '@@@BUILD_STEP Build CMake@@@' )
5758 CallSubProcess (
5859 ['/bin/bash' , 'bootstrap' , '--prefix=%s' % CMAKE_DIR ],
5960 cwd = CMAKE_DIR )
@@ -74,7 +75,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
7475 if not format :
7576 format = title
7677
77- print '@@@BUILD_STEP ' + title + '@@@'
78+ print ( '@@@BUILD_STEP ' + title + '@@@' )
7879 sys .stdout .flush ()
7980 env = os .environ .copy ()
8081 if msvs_version :
@@ -89,17 +90,17 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
8990 retcode = subprocess .call (command , cwd = ROOT_DIR , env = env , shell = True )
9091 if retcode :
9192 # Emit failure tag, and keep going.
92- print '@@@STEP_FAILURE@@@'
93+ print ( '@@@STEP_FAILURE@@@' )
9394 return 1
9495 return 0
9596
9697
9798def GypBuild ():
9899 # Dump out/ directory.
99- print '@@@BUILD_STEP cleanup@@@'
100- print 'Removing %s...' % OUT_DIR
100+ print ( '@@@BUILD_STEP cleanup@@@' )
101+ print ( 'Removing %s...' % OUT_DIR )
101102 shutil .rmtree (OUT_DIR , ignore_errors = True )
102- print 'Done.'
103+ print ( 'Done.' )
103104
104105 retcode = 0
105106 if sys .platform .startswith ('linux' ):
@@ -128,7 +129,7 @@ def GypBuild():
128129 # after the build proper that could be used for cumulative failures),
129130 # use that instead of this. This isolates the final return value so
130131 # that it isn't misattributed to the last stage.
131- print '@@@BUILD_STEP failures@@@'
132+ print ( '@@@BUILD_STEP failures@@@' )
132133 sys .exit (retcode )
133134
134135
0 commit comments