summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-07-25 12:06:51 +0300
committerimarom <imarom@cisco.com>2016-07-25 12:06:51 +0300
commit4e40d7059985e968eb547581865b603e3d7f78d3 (patch)
tree780d3320654b3f8a872a7ea5dcd2a4cf9838dc8a
parenta913ed85424bd1ab38c8842dd16dd10b90db12fe (diff)
TUI - stdout close/reopen issues
-rw-r--r--scripts/automation/trex_control_plane/stl/console/trex_tui.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/stl/console/trex_tui.py b/scripts/automation/trex_control_plane/stl/console/trex_tui.py
index 2e26fdfc..81ba335c 100644
--- a/scripts/automation/trex_control_plane/stl/console/trex_tui.py
+++ b/scripts/automation/trex_control_plane/stl/console/trex_tui.py
@@ -619,19 +619,15 @@ class AsyncKeys:
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, new_settings)
# huge buffer - no print without flush
- tmp_fd = os.dup(sys.stdout.fileno())
- sys.stdout.close()
- sys.stdout = os.fdopen(tmp_fd, 'w', 80 * 25 * 2)
-
+ sys.stdout = open('/dev/stdout', 'w', TrexTUI.MIN_COLS * TrexTUI.MIN_COLS * 2)
return self
def __exit__ (self, type, value, traceback):
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, self.old_settings)
# restore sys.stdout
- tmp_fd = os.dup(sys.stdout.fileno())
sys.stdout.close()
- sys.stdout = os.fdopen(tmp_fd, 'w', -1)
+ sys.stdout = sys.__stdout__
def is_legend_mode (self):