Use six.moves.input instead of raw_input (#3961)
* Use six.moves.input instead of raw_input * Remove comment mentioning raw_input
This commit is contained in:
parent
67bf71630b
commit
c144c88302
@ -30,6 +30,7 @@
|
|||||||
import struct
|
import struct
|
||||||
import traceback
|
import traceback
|
||||||
from six import StringIO
|
from six import StringIO
|
||||||
|
from six.moves import input
|
||||||
|
|
||||||
from llnl.util.tty.color import *
|
from llnl.util.tty.color import *
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ def get_number(prompt, **kwargs):
|
|||||||
number = None
|
number = None
|
||||||
while number is None:
|
while number is None:
|
||||||
msg(prompt, newline=False)
|
msg(prompt, newline=False)
|
||||||
ans = raw_input()
|
ans = input()
|
||||||
if ans == str(abort):
|
if ans == str(abort):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -197,7 +198,7 @@ def get_yes_or_no(prompt, **kwargs):
|
|||||||
result = None
|
result = None
|
||||||
while result is None:
|
while result is None:
|
||||||
msg(prompt, newline=False)
|
msg(prompt, newline=False)
|
||||||
ans = raw_input().lower()
|
ans = input().lower()
|
||||||
if not ans:
|
if not ans:
|
||||||
result = default_value
|
result = default_value
|
||||||
if result is None:
|
if result is None:
|
||||||
|
@ -1228,7 +1228,7 @@ def build_process(input_stream):
|
|||||||
# otherwise it should not have passed us the copy of the stream.
|
# otherwise it should not have passed us the copy of the stream.
|
||||||
# Thus, we are free to work with the the copy (input_stream)
|
# Thus, we are free to work with the the copy (input_stream)
|
||||||
# however we want. For example, we might want to call functions
|
# however we want. For example, we might want to call functions
|
||||||
# (e.g. raw_input()) that implicitly read from whatever stream is
|
# (e.g. input()) that implicitly read from whatever stream is
|
||||||
# assigned to sys.stdin. Since we want them to work with the
|
# assigned to sys.stdin. Since we want them to work with the
|
||||||
# original input stream, we are making the following assignment:
|
# original input stream, we are making the following assignment:
|
||||||
sys.stdin = input_stream
|
sys.stdin = input_stream
|
||||||
|
Loading…
Reference in New Issue
Block a user