1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
9 """Prompts with a yes/no question, returns True if yes."""
12 # http://code.activestate.com/recipes/134892/
13 if sys.platform == 'win32':
19 fd = sys.stdin.fileno()
20 old_settings = termios.tcgetattr(fd)
23 tty.setraw(sys.stdin.fileno())
24 ch = sys.stdin.read(1)
26 termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
28 return ch in ('Y', 'y')