Don't tracback trying to retore settings
Can occur if we exit the timeout before the settings were changed
This commit is contained in:
parent
27bf701260
commit
089f17bfc8
1 changed files with 3 additions and 1 deletions
|
@ -105,6 +105,8 @@ class ActionModule(ActionBase):
|
|||
result['start'] = str(datetime.datetime.now())
|
||||
result['user_input'] = ''
|
||||
|
||||
fd = None
|
||||
old_settings = None
|
||||
try:
|
||||
if seconds is not None:
|
||||
# setup the alarm handler
|
||||
|
@ -159,7 +161,7 @@ class ActionModule(ActionBase):
|
|||
finally:
|
||||
# cleanup and save some information
|
||||
# restore the old settings for the duped stdin fd
|
||||
if isatty(fd):
|
||||
if not(None in (fd, old_settings)) and isatty(fd):
|
||||
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
||||
|
||||
duration = time.time() - start
|
||||
|
|
Loading…
Reference in a new issue