mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Get rid of a bunch more raw_input references
This commit is contained in:
parent
9e2b9665ae
commit
ce96f69d69
42 changed files with 222 additions and 144 deletions
|
|
@ -352,6 +352,11 @@ class LoggingFile:
|
|||
def close(self):
|
||||
self.outfp.write('\n')
|
||||
|
||||
def raw_input(prompt):
|
||||
sys.stdout.write(prompt)
|
||||
sys.stdout.flush()
|
||||
return sys.stdin.readline()
|
||||
|
||||
# Ask permission to download a file.
|
||||
def askabout(filetype, filename, pwd):
|
||||
prompt = 'Retrieve %s %s from %s ? [ny] ' % (filetype, filename, pwd)
|
||||
|
|
|
|||
|
|
@ -187,6 +187,11 @@ def copy(src, dst, rmode="rb", wmode="wb", answer='ask'):
|
|||
f.close()
|
||||
g.close()
|
||||
|
||||
def raw_input(prompt):
|
||||
sys.stdout.write(prompt)
|
||||
sys.stdout.flush()
|
||||
return sys.stdin.readline()
|
||||
|
||||
def okay(prompt, answer='ask'):
|
||||
answer = answer.strip().lower()
|
||||
if not answer or answer[0] not in 'ny':
|
||||
|
|
|
|||
|
|
@ -105,6 +105,11 @@ def showdiffs(file):
|
|||
cmd = 'rcsdiff ' + file + ' 2>&1 | ${PAGER-more}'
|
||||
sts = os.system(cmd)
|
||||
|
||||
def raw_input(prompt):
|
||||
sys.stdout.write(prompt)
|
||||
sys.stdout.flush()
|
||||
return sys.stdin.readline()
|
||||
|
||||
def askyesno(prompt):
|
||||
s = raw_input(prompt)
|
||||
return s in ['y', 'yes']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue