@contextmanager
def preserve_stty_settings():
 stty_settings = STTYSettings()
 stty_settings.save_stty_options()
 (yield)
 stty_settings.restore_ssty_options()

@ contextmanager def preserve_stty_settings ( ) : stty_settings = STTYSettings ( ) stty_settings . save_stty_options ( ) ( yield ) stty_settings . restore_ssty_options ( )
run potentially stty-modifying operations .