mercurial/util.py
changeset 2096 f5ebe964c6be
parent 2090 eb40db373717
child 2115 fd77b7ee4aac
equal deleted inserted replaced
2095:0bf2a9e5eff1 2096:f5ebe964c6be
    18 
    18 
    19 def pipefilter(s, cmd):
    19 def pipefilter(s, cmd):
    20     '''filter string S through command CMD, returning its output'''
    20     '''filter string S through command CMD, returning its output'''
    21     (pout, pin) = popen2.popen2(cmd, -1, 'b')
    21     (pout, pin) = popen2.popen2(cmd, -1, 'b')
    22     def writer():
    22     def writer():
    23         pin.write(s)
    23         try:
    24         pin.close()
    24             pin.write(s)
       
    25             pin.close()
       
    26         except IOError, inst:
       
    27             if inst.errno != errno.EPIPE:
       
    28                 raise
    25 
    29 
    26     # we should use select instead on UNIX, but this will work on most
    30     # we should use select instead on UNIX, but this will work on most
    27     # systems, including Windows
    31     # systems, including Windows
    28     w = threading.Thread(target=writer)
    32     w = threading.Thread(target=writer)
    29     w.start()
    33     w.start()