MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / _restore_stdout

Method _restore_stdout

PySimpleGUI/PySimpleGUI.py:12571–12580  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

12569
12570 @classmethod
12571 def _restore_stdout(cls):
12572 for item in cls._rerouted_stdout_stack:
12573 (window, element) = item # type: (Window, Element)
12574 if not window.is_closed():
12575 sys.stdout = element
12576 break
12577 cls._rerouted_stdout_stack = [item for item in cls._rerouted_stdout_stack if not item[0].is_closed()]
12578 if len(cls._rerouted_stdout_stack) == 0 and cls._original_stdout is not None:
12579 sys.stdout = cls._original_stdout
12580 # print('Restored stdout... new stack:', [item[0].Title for item in cls._rerouted_stdout_stack ])
12581
12582 @classmethod
12583 def _restore_stderr(cls):

Callers 3

closeMethod · 0.95
_OnClosingCallbackMethod · 0.95
restore_stdoutMethod · 0.80

Calls 1

is_closedMethod · 0.80

Tested by

no test coverage detected