def await_results(program, timeout_seconds=2):
 countdown = (timeout_seconds * 10)
 while ((program.poll() is None) and (countdown > 0)):
  time.sleep(0.1)
  countdown -= 1
 if (countdown == 0):
  program.kill()
  raise TimeoutFailure('<program timed out>')

def await_results ( program , timeout_seconds = 2 ) : countdown = ( timeout_seconds * 10 ) while ( ( program . poll ( ) is None ) and ( countdown > 0 ) ) : time . sleep ( 0.1 ) countdown -= 1 if ( countdown == 0 ) : program . kill ( ) raise TimeoutFailure ( '<program timed out>' )
this polls the child program until it finishes executing .