#NEWLINE# def __init__( self , reactor , executable , args , environment , path , proto , uid = None , gid = None , usePTY = None ) : #NEWLINE# #INDENT# "\n        Spawn an operating-system process.\n\n        This is where the hard work of disconnecting all currently open\n        files / forking / executing the new process happens.  (This is\n        executed automatically when a Process is instantiated.)\n\n        This will also run the subprocess as a given user ID and group ID, if\n        specified.  (Implementation Note: this doesn't support all the arcane\n        nuances of setXXuid on UNIX: it will assume that either your effective\n        or real UID is 0.)\n        " #NEWLINE# if ( ( pty is None ) and ( not isinstance ( usePTY , ( tuple , list ) ) ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'cannot use PTYProcess on platforms without the pty module.' ) #NEWLINE# #UNINDENT# abstract . FileDescriptor . __init__ ( self , reactor ) #NEWLINE# _BaseProcess . __init__ ( self , proto ) #NEWLINE# if isinstance ( usePTY , ( tuple , list ) ) : #NEWLINE# #INDENT# ( masterfd , slavefd , _ ) = usePTY #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( masterfd , slavefd ) = pty . openpty ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . _fork ( path , uid , gid , executable , args , environment , masterfd = masterfd , slavefd = slavefd ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# if ( not isinstance ( usePTY , ( tuple , list ) ) ) : #NEWLINE# #INDENT# os . close ( masterfd ) #NEWLINE# os . close ( slavefd ) #NEWLINE# #UNINDENT# raise #NEWLINE# #UNINDENT# os . close ( slavefd ) #NEWLINE# fdesc . setNonBlocking ( masterfd ) #NEWLINE# self . fd = masterfd #NEWLINE# self . startReading ( ) #NEWLINE# self . connected = 1 #NEWLINE# self . status = ( - 1 ) #NEWLINE# try : #NEWLINE# #INDENT# self . proto . makeConnection ( self ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . err ( ) #NEWLINE# #UNINDENT# registerReapProcessHandler ( self . pid , self )