#NEWLINE# def _set_cloexec( self ) : #NEWLINE# #INDENT# 'Set the CLOEXEC flag on all open files (except stdin/out/err).\n\n        If self.max_cloexec_files is an integer (the default), then on\n        platforms which support it, it represents the max open files setting\n        for the operating system. This function will be called just before\n        the process is restarted via os.execv() to prevent open files\n        from persisting into the new process.\n\n        Set self.max_cloexec_files to 0 to disable this behavior.\n        ' #NEWLINE# for fd in range ( 3 , self . max_cloexec_files ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# flags = fcntl . fcntl ( fd , fcntl . F_GETFD ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# fcntl . fcntl ( fd , fcntl . F_SETFD , ( flags | fcntl . FD_CLOEXEC ) )