def detectLinuxBrokenPipeBehavior():
 (r, w) = os.pipe()
 os.write(w, 'a')
 (reads, writes, exes) = select.select([w], [], [], 0)
 if reads:
  brokenPipeBehavior = True
 else:
  brokenPipeBehavior = False
 os.close(r)
 os.close(w)
 return brokenPipeBehavior

def detectLinuxBrokenPipeBehavior ( ) : ( r , w ) = os . pipe ( ) os . write ( w , 'a' ) ( reads , writes , exes ) = select . select ( [ w ] , [ ] , [ ] , 0 ) if reads : brokenPipeBehavior = True else : brokenPipeBehavior = False os . close ( r ) os . close ( w ) return brokenPipeBehavior
on some linux version .