From a1b01ee7fbe41256be47b50b67d07e50db98b266 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Wed, 24 Jan 2018 14:05:42 -0800 Subject: [PATCH] [autoscaler] Fix confirmation (y/N) for autoscaler for Python 2 (#1450) * Fix autoscaler for Python 2 * fix version test * add linting exception for raw_input in Python 3 * two spaces --- python/ray/autoscaler/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/ray/autoscaler/commands.py b/python/ray/autoscaler/commands.py index e283eb970..c494a1443 100644 --- a/python/ray/autoscaler/commands.py +++ b/python/ray/autoscaler/commands.py @@ -171,7 +171,10 @@ def get_or_create_head_node(config, no_restart): def confirm(msg): print("{}. Do you want to continue [y/N]? ".format(msg), end="") - answer = input() + if sys.version_info >= (3, 0): + answer = input() + else: + answer = raw_input() # noqa: F821 if answer.strip().lower() != "y": print("Abort.") exit(1)