In some cases (looking at you s390x again) select may report there's something
on stdin while there's nothing and stdin.read(1) returns nothing. If that
happens, we are good to stop reading from stdin because there's nothing queued.
Related: rhbz#1162702
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/lib/entropy.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/lib/entropy.py b/pyanaconda/ui/lib/entropy.py
index 52e595d..401053b 100644
--- a/pyanaconda/ui/lib/entropy.py
+++ b/pyanaconda/ui/lib/entropy.py
@@ -116,9 +116,10 @@ def _tui_wait(msg, desired_entropy):
# and then just read everything from the input buffer and revert the
# termios state
- while sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
+ data = "have something"
+ while sys.stdin in select.select([sys.stdin], [], [], 0)[0] and data:
# just read from stdin and scratch the read data
- sys.stdin.read(1)
+ data = sys.stdin.read(1)
if termios_attrs_changed:
termios.tcsetattr(fd, termios.TCSAFLUSH, old)
--
1.9.3