File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,9 @@ def whileRunningFile(self, event=None):
117117 newOutput = self ._stdoutThread .getBuffer ()
118118 if newOutput :
119119 sys .stdout .write (newOutput )
120- returnVal = self .scriptProcess .poll ()
121- if returnVal is not None :
120+ if (self .scriptProcess is None
121+ or self .scriptProcess .poll () is not None ):
122+ # no script or poll() sent a returncode (None means still running)
122123 self .onProcessEnded ()
123124 else :
124125 time .sleep (0.1 ) # let's not check too often
@@ -130,13 +131,14 @@ def onProcessEnded(self, event=None):
130131 wx .EndBusyCursor ()
131132 except wx ._core .wxAssertionError :
132133 pass
134+ self .scriptProcess = None
135+ self .Bind (wx .EVT_IDLE , None )
136+ # handle stdout
133137 self ._stdoutThread .exit = True
134138 time .sleep (0.1 ) # give time for the buffers to finish writing?
135139 buff = self ._stdoutThread .getBuffer ()
136140 self .app .runner .stdOut .write (buff )
137141 self .app .runner .stdOut .flush ()
138142 self .app .runner .Show ()
139143
140- self .scriptProcess = None
141- self .Bind (wx .EVT_IDLE , None )
142144 print ("##### Experiment ended. #####\n " )
You can’t perform that action at this time.
0 commit comments