Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

stable hgcmd: disable redirect of stdout file descriptor for non-Windows

Refs #783

Changeset 61f718a7cca9

Parent e3f0793381ad

by Steve Borho

Changes to one file · Browse files at 61f718a7cca9 Showing diff from parent e3f0793381ad Diff from another changeset...

 
127
128
129
130
131
132
133
134
135
 
 
 
 
 
 
 
 
136
137
138
 
192
193
194
195
196
 
 
 
197
198
199
 
127
128
129
 
130
 
 
 
 
131
132
133
134
135
136
137
138
139
140
141
 
195
196
197
 
 
198
199
200
201
202
203
@@ -127,12 +127,15 @@
  self.stdoutq.put(o)   else:   break - self.oldstdout = os.dup(sys.__stdout__.fileno())   self.stdoutq = Queue.Queue() - self.readfd, writefd = os.pipe() - os.dup2(writefd, sys.__stdout__.fileno()) - thread = threading.Thread(target=pollstdout, args=[]) - thread.start() + if os.name == 'nt': + # Only capture stdout on Windows. This causes hard crashes + # on some other platforms. See issue #783 + self.readfd, writefd = os.pipe() + self.oldstdout = os.dup(sys.__stdout__.fileno()) + os.dup2(writefd, sys.__stdout__.fileno()) + thread = threading.Thread(target=pollstdout, args=[]) + thread.start()     self.hgthread = hgthread.HgThread(self.cmdline[1:])   self.hgthread.start() @@ -192,8 +195,9 @@
  self._button_stop.set_sensitive(False)   self._button_ok.set_sensitive(True)   self._button_ok.grab_focus() - os.dup2(self.oldstdout, sys.__stdout__.fileno()) - os.close(self.oldstdout) + if os.name == 'nt': + os.dup2(self.oldstdout, sys.__stdout__.fileno()) + os.close(self.oldstdout)   return False # Stop polling this function   else:   return True