Skip to content

Commit

Permalink
BF: Move code to set stdout to the Runner to showRunner, fixes #3105.…
Browse files Browse the repository at this point in the history
… Elementary, my dear Watson.
  • Loading branch information
Todd authored and Todd committed Oct 1, 2020
1 parent 97ab5ca commit 4773ec3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions psychopy/app/_psychopyApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,6 @@ def onInit(self, showSplash=True, testMode=False):
# we wanted debug mode while loading but safe to go back to info mode
if not self.prefs.app['debugMode']:
logging.console.setLevel(logging.INFO)
# Runner captures standard streams until program closed
if self.runner and not self.testMode:
sys.stdout = self.runner.stdOut
sys.stderr = self.runner.stdOut

return True

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

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

0 comments on commit 4773ec3

Please sign in to comment.