mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 20:40:09 +08:00
[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
This commit is contained in:
committed by
Eric Liang
parent
a7d544424c
commit
a1b01ee7fb
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user