Skip to content

Commit 4773ec3

Browse files
ToddTodd
authored andcommitted
BF: Move code to set stdout to the Runner to showRunner, fixes #3105. Elementary, my dear Watson.
1 parent 97ab5ca commit 4773ec3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

psychopy/app/_psychopyApp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,6 @@ def onInit(self, showSplash=True, testMode=False):
427427
# we wanted debug mode while loading but safe to go back to info mode
428428
if not self.prefs.app['debugMode']:
429429
logging.console.setLevel(logging.INFO)
430-
# Runner captures standard streams until program closed
431-
if self.runner and not self.testMode:
432-
sys.stdout = self.runner.stdOut
433-
sys.stderr = self.runner.stdOut
434430

435431
return True
436432

@@ -593,6 +589,10 @@ def showRunner(self, event=None, fileList=[]):
593589
self.runner.Show()
594590
self.runner.Raise()
595591
self.SetTopWindow(self.runner)
592+
# Runner captures standard streams until program closed
593+
if self.runner and not self.testMode:
594+
sys.stdout = self.runner.stdOut
595+
sys.stderr = self.runner.stdOut
596596

597597
def newRunnerFrame(self, event=None):
598598
# have to reimport because it is only local to __init__ so far

0 commit comments

Comments
 (0)