##// END OF EJS Templates
Fix references to raw_input()
Thomas Kluyver -
Show More
@@ -28,6 +28,7 b' from pprint import pformat'
28 28 from IPython.core import ultratb
29 29 from IPython.core.release import author_email
30 30 from IPython.utils.sysinfo import sys_info
31 from IPython.utils.py3compat import input
31 32
32 33 #-----------------------------------------------------------------------------
33 34 # Code
@@ -176,7 +177,7 b' class CrashHandler(object):'
176 177 # Construct report on disk
177 178 report.write(self.make_report(traceback))
178 179 report.close()
179 raw_input("Hit <Enter> to quit (your terminal may close):")
180 input("Hit <Enter> to quit (your terminal may close):")
180 181
181 182 def make_report(self,traceback):
182 183 """Return a string containing a crash report."""
@@ -314,7 +314,7 b" if os.name == 'nt' and os.environ.get('TERM','dumb') != 'emacs':"
314 314 return result
315 315 else:
316 316 def page_more():
317 ans = raw_input('---Return to continue, q to quit--- ')
317 ans = py3compat.input('---Return to continue, q to quit--- ')
318 318 if ans.lower().startswith('q'):
319 319 return False
320 320 else:
@@ -345,6 +345,6 b" def snip_print(str,width = 75,print_full = 0,header = ''):"
345 345 print(str[:whalf] + ' <...> ' + str[-whalf:])
346 346 snip = 1
347 347 if snip and print_full == 2:
348 if raw_input(header+' Snipped. View (y/n)? [N]').lower() == 'y':
348 if py3compat.input(header+' Snipped. View (y/n)? [N]').lower() == 'y':
349 349 page(str)
350 350 return snip
@@ -29,7 +29,7 b' from IPython.core import inputsplitter as isp'
29 29 from IPython.core.tests.test_inputtransformer import syntax, syntax_ml
30 30 from IPython.testing import tools as tt
31 31 from IPython.utils import py3compat
32 from IPython.utils.py3compat import string_types
32 from IPython.utils.py3compat import string_types, input
33 33
34 34 #-----------------------------------------------------------------------------
35 35 # Semi-complete examples (also used as tests)
@@ -489,9 +489,9 b" if __name__ == '__main__':"
489 489 while isp.push_accepts_more():
490 490 indent = ' '*isp.indent_spaces
491 491 if autoindent:
492 line = indent + raw_input(prompt+indent)
492 line = indent + input(prompt+indent)
493 493 else:
494 line = raw_input(prompt)
494 line = input(prompt)
495 495 isp.push(line)
496 496 prompt = '... '
497 497
@@ -186,6 +186,7 b' import sys'
186 186 from IPython.utils import io
187 187 from IPython.utils.text import marquee
188 188 from IPython.utils import openpy
189 from IPython.utils import py3compat
189 190 __all__ = ['Demo','IPythonDemo','LineDemo','IPythonLineDemo','DemoError']
190 191
191 192 class DemoError(Exception): pass
@@ -449,7 +450,7 b' class Demo(object):'
449 450 print(marquee('output:'), file=io.stdout)
450 451 else:
451 452 print(marquee('Press <q> to quit, <Enter> to execute...'), end=' ', file=io.stdout)
452 ans = raw_input().strip()
453 ans = py3compat.input().strip()
453 454 if ans:
454 455 print(marquee('Block NOT executed'), file=io.stdout)
455 456 return
@@ -12,6 +12,7 b' import subprocess'
12 12
13 13 from IPython import get_ipython
14 14 from IPython.core.error import TryNext
15 from IPython.utils import py3compat
15 16
16 17
17 18 def install_editor(template, wait=False):
@@ -51,7 +52,7 b' def install_editor(template, wait=False):'
51 52 if wait and proc.wait() != 0:
52 53 raise TryNext()
53 54 if wait:
54 raw_input("Press Enter when done editing:")
55 py3compat.input("Press Enter when done editing:")
55 56
56 57 get_ipython().set_hook('editor', call_editor)
57 58 get_ipython().editor = template
@@ -31,7 +31,7 b' except ImportError:'
31 31 from IPython.core import page
32 32 from IPython.utils.warn import warn, error
33 33 from IPython.utils import io
34 from IPython.utils.py3compat import string_types
34 from IPython.utils.py3compat import string_types, input
35 35 from IPython.utils.traitlets import List, Enum, Any, Instance, Unicode, Float
36 36 from IPython.utils.tempdir import NamedFileInTemporaryDirectory
37 37
@@ -330,7 +330,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):'
330 330 signal.signal(signal.SIGINT, double_int)
331 331
332 332 try:
333 raw_data = raw_input(msg_rep["content"]["prompt"])
333 raw_data = input(msg_rep["content"]["prompt"])
334 334 except EOFError:
335 335 # turn EOFError into EOF character
336 336 raw_data = '\x04'
@@ -18,7 +18,7 b' import os'
18 18 import sys
19 19 import tempfile
20 20 from .capture import CapturedIO, capture_output
21 from .py3compat import string_types
21 from .py3compat import string_types, input
22 22
23 23 #-----------------------------------------------------------------------------
24 24 # Code
@@ -170,7 +170,7 b' def ask_yes_no(prompt,default=None):'
170 170 ans = None
171 171 while ans not in answers.keys():
172 172 try:
173 ans = raw_input(prompt+' ').lower()
173 ans = input(prompt+' ').lower()
174 174 if not ans: # response was an empty string
175 175 ans = default
176 176 except KeyboardInterrupt:
General Comments 0
You need to be logged in to leave comments. Login now