mercurial/windows.py
changeset 10282 08a0f04b56bd
parent 10264 d6512b3e9ac0
child 10394 4612cded5176
equal deleted inserted replaced
10281:e7d3b509af8b 10282:08a0f04b56bd
    45             while start < l:
    45             while start < l:
    46                 end = start + limit
    46                 end = start + limit
    47                 self.fp.write(s[start:end])
    47                 self.fp.write(s[start:end])
    48                 start = end
    48                 start = end
    49         except IOError, inst:
    49         except IOError, inst:
    50             if inst.errno != 0: raise
    50             if inst.errno != 0:
       
    51                 raise
    51             self.close()
    52             self.close()
    52             raise IOError(errno.EPIPE, 'Broken pipe')
    53             raise IOError(errno.EPIPE, 'Broken pipe')
    53 
    54 
    54     def flush(self):
    55     def flush(self):
    55         try:
    56         try:
    56             return self.fp.flush()
    57             return self.fp.flush()
    57         except IOError, inst:
    58         except IOError, inst:
    58             if inst.errno != errno.EINVAL: raise
    59             if inst.errno != errno.EINVAL:
       
    60                 raise
    59             self.close()
    61             self.close()
    60             raise IOError(errno.EPIPE, 'Broken pipe')
    62             raise IOError(errno.EPIPE, 'Broken pipe')
    61 
    63 
    62 sys.stdout = winstdout(sys.stdout)
    64 sys.stdout = winstdout(sys.stdout)
    63 
    65 
   331         dwFlags = subprocess.STARTF_USESHOWWINDOW
   333         dwFlags = subprocess.STARTF_USESHOWWINDOW
   332         hStdInput = None
   334         hStdInput = None
   333         hStdOutput = None
   335         hStdOutput = None
   334         hStdError = None
   336         hStdError = None
   335         wShowWindow = subprocess.SW_HIDE
   337         wShowWindow = subprocess.SW_HIDE
   336         
   338 
   337     args = subprocess.list2cmdline(args)
   339     args = subprocess.list2cmdline(args)
   338     # Not running the command in shell mode makes python26 hang when
   340     # Not running the command in shell mode makes python26 hang when
   339     # writing to hgweb output socket.
   341     # writing to hgweb output socket.
   340     comspec = os.environ.get("COMSPEC", "cmd.exe")
   342     comspec = os.environ.get("COMSPEC", "cmd.exe")
   341     args = comspec + " /c " + args
   343     args = comspec + " /c " + args