The Solaris curses library has a broken timeout() function: after a
first timeout() call with a positive value for an argument, subsequent
calls will fail to reset it. So, getch() always times out, confusing
the pygrub timer in the main loop. Add an extra check to avoid exiting
prematurely.
Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
# Timed out waiting for a keypress
if mytime != -1:
mytime += 1
- if mytime >= int(timeout):
+ # curses.timeout() does not work properly on Solaris
+ # So we may come here even after a key has been pressed.
+ # Check both timeout and mytime to avoid exiting
+ # when we shouldn't.
+ if timeout != -1 and mytime >= int(timeout):
self.isdone = True
break
else: