def _spawn(script, outputFD):
 pyExe = FilePath(sys.executable).asBytesMode().path
 env = bytesEnviron()
 env['PYTHONPATH'] = FilePath(pathsep.join(sys.path)).asBytesMode().path
 sspp = StartStopProcessProtocol()
 reactor.spawnProcess(sspp, pyExe, [pyExe, FilePath(__file__).sibling((script + '.py')).asBytesMode().path, intToBytes(outputFD)], env=env, childFDs={0: 'w', 1: 'r', 2: 'r', outputFD: outputFD})
 return sspp

def _spawn ( script , outputFD ) : pyExe = FilePath ( sys . executable ) . asBytesMode ( ) . path env = bytesEnviron ( ) env [ 'PYTHONPATH' ] = FilePath ( pathsep . join ( sys . path ) ) . asBytesMode ( ) . path sspp = StartStopProcessProtocol ( ) reactor . spawnProcess ( sspp , pyExe , [ pyExe , FilePath ( __file__ ) . sibling ( ( script + '.py' ) ) . asBytesMode ( ) . path , intToBytes ( outputFD ) ] , env = env , childFDs = { 0 : 'w' , 1 : 'r' , 2 : 'r' , outputFD : outputFD } ) return sspp
start a script that is a peer of this test as a subprocess .