#NEWLINE# def doRead( self ) : #NEWLINE# #INDENT# '\n        The only way a write pipe can become "readable" is at EOF, because the\n        child has closed it, and we\'re using a reactor which doesn\'t\n        distinguish between readable and closed (such as the select reactor).\n\n        Except that\'s not true on linux < 2.6.11. It has the following\n        characteristics: write pipe is completely empty => POLLOUT (writable in\n        select), write pipe is not completely empty => POLLIN (readable in\n        select), write pipe\'s reader closed => POLLIN|POLLERR (readable and\n        writable in select)\n\n        That\'s what this funky code is for. If linux was not broken, this\n        function could be simply "return CONNECTION_LOST".\n\n        BUG: We call select no matter what the reactor.\n        If the reactor is pollreactor, and the fd is > 1024, this will fail.\n        (only occurs on broken versions of linux, though).\n        ' #NEWLINE# if self . enableReadHack : #NEWLINE# #INDENT# if brokenLinuxPipeBehavior : #NEWLINE# #INDENT# fd = self . fd #NEWLINE# ( r , w , x ) = select . select ( [ fd ] , [ fd ] , [ ] , 0 ) #NEWLINE# if ( r and w ) : #NEWLINE# #INDENT# return CONNECTION_LOST #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return CONNECTION_LOST #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . stopReading ( )