@@ -247,7 +247,7 @@ def find_binary(name):
247247 # Execute the command.
248248 try :
249249 cmd_object .execute (verbose = verbose )
250- except OSError , e :
250+ except OSError as e :
251251 # Python's exceptions are horribly to read, and this one is
252252 # incredibly common when people don't use the right syntax (or
253253 # misspell something) when writing a predicate. Detect this and
@@ -277,9 +277,9 @@ def find_binary(name):
277277 data = f .read ()
278278 f .close ()
279279 if data :
280- print ("-- command %s (note: suppressed by default, "
281- "see sandbox dir for log files) --" % (type ))
282- print "--\n %s--\n " % data
280+ print ("-- command %s (note: suppressed by default, "
281+ "see sandbox dir for log files) --" % (type ))
282+ print ( "--\n %s--\n " % data )
283283
284284 test_result = cmd_object .result
285285 if not test_result :
@@ -393,8 +393,8 @@ def action_fetch(name, args):
393393 fatal ('current directory is not clean, %r exists' % p )
394394 llvmlab .fetch_build_to_path (builder , build , root_path , builddir_path )
395395
396- print 'downloaded root: %s' % root_path
397- print 'extracted path : %s' % builddir_path
396+ print ( 'downloaded root: %s' % root_path )
397+ print ( 'extracted path : %s' % builddir_path )
398398
399399 # Update the symbolic link, if requested.
400400 if not opts .dry_run and opts .update_link :
@@ -408,7 +408,7 @@ def action_fetch(name, args):
408408
409409 # Create the symbolic link.
410410 os .symlink (os .path .abspath (builddir_path ), opts .update_link )
411- print 'updated link at: %s' % opts .update_link
411+ print ( 'updated link at: %s' % opts .update_link )
412412 return os .path .abspath (builddir_path )
413413
414414
@@ -428,19 +428,19 @@ def action_ls(name, args):
428428 available_buildnames = llvmlab .fetch_builders ()
429429 available_buildnames .sort ()
430430 for item in available_buildnames :
431- print item
431+ print ( item )
432432 return available_buildnames
433433
434434 for name in args :
435435 if len (args ) > 1 :
436436 if name is not args [0 ]:
437- print
438- print '%s:' % name
437+ print ()
438+ print ( '%s:' % name )
439439 available_builds = list (llvmlab .fetch_builds (name ))
440440 available_builds .sort ()
441441 available_builds .reverse ()
442442 for build in available_builds :
443- print build .tobasename (include_suffix = False )
443+ print ( build .tobasename (include_suffix = False ) )
444444 min_rev = min ([x .revision for x in available_builds ])
445445 max_rev = max ([x .revision for x in available_builds ])
446446 note ("Summary: found {} builds: r{}-r{}" .format (len (available_builds ),
@@ -546,8 +546,8 @@ def predicate(item):
546546 show_command_output = opts .show_command_output or opts .very_verbose )
547547
548548 # Print status.
549- print '%s: %s' % (('FAIL' , 'PASS' )[test_result ],
550- item .tobasename (include_suffix = False ))
549+ print ( '%s: %s' % (('FAIL' , 'PASS' )[test_result ],
550+ item .tobasename (include_suffix = False )))
551551
552552 return test_result
553553
@@ -571,13 +571,13 @@ def predicate(item):
571571 if item is None :
572572 fatal ('unable to find any passing build!' )
573573
574- print '%s: first working build' % item .tobasename (include_suffix = False )
574+ print ( '%s: first working build' % item .tobasename (include_suffix = False ) )
575575 index = available_builds .index (item )
576576 if index == 0 :
577- print 'no failing builds!?'
577+ print ( 'no failing builds!?' )
578578 else :
579- print '%s: next failing build' % available_builds [index - 1 ].tobasename (
580- include_suffix = False )
579+ print ( '%s: next failing build' % available_builds [index - 1 ].tobasename (
580+ include_suffix = False ))
581581
582582
583583def action_exec (name , args ):
@@ -643,8 +643,8 @@ def action_exec(name, args):
643643 opts .sandbox , opts .build_name , build , args , verbose = True ,
644644 show_command_output = True )
645645
646- print '%s: %s' % (('FAIL' , 'PASS' )[test_result ],
647- build .tobasename (include_suffix = False ))
646+ print ( '%s: %s' % (('FAIL' , 'PASS' )[test_result ],
647+ build .tobasename (include_suffix = False )))
648648
649649 raise SystemExit (test_result != True )
650650
0 commit comments