##// END OF EJS Templates
remove rest of readline, pass II
Matthias Bussonnier -
Show More
@@ -62,7 +62,6 b' from IPython.utils import PyColorize'
62 62 from IPython.utils import io
63 63 from IPython.utils import py3compat
64 64 from IPython.utils import openpy
65 from IPython.utils.contexts import NoOpContext
66 65 from IPython.utils.decorators import undoc
67 66 from IPython.utils.io import ask_yes_no
68 67 from IPython.utils.ipstruct import Struct
@@ -574,9 +573,6 b' class InteractiveShell(SingletonConfigurable):'
574 573 self.tempfiles = []
575 574 self.tempdirs = []
576 575
577 # Keep track of readline usage (later set by init_readline)
578 self.has_readline = False
579
580 576 # keep track of where we started running (mainly for crash post-mortem)
581 577 # This is not being used anywhere currently.
582 578 self.starting_dir = py3compat.getcwd()
@@ -659,9 +655,6 b' class InteractiveShell(SingletonConfigurable):'
659 655 # override sys.stdout and sys.stderr themselves, you need to do that
660 656 # *before* instantiating this class, because io holds onto
661 657 # references to the underlying streams.
662 if (sys.platform == 'win32' or sys.platform == 'cli') and self.has_readline:
663 io.stdout = io.stderr = io.IOStream(self.readline._outputfile)
664 else:
665 658 io.stdout = io.IOStream(sys.stdout)
666 659 io.stderr = io.IOStream(sys.stderr)
667 660
@@ -984,8 +977,6 b' class InteractiveShell(SingletonConfigurable):'
984 977 error('No traceback has been produced, nothing to debug.')
985 978 return
986 979
987
988 with self.readline_no_record:
989 980 self.InteractiveTB.debugger(force=True)
990 981
991 982 #-------------------------------------------------------------------------
@@ -1889,10 +1880,7 b' class InteractiveShell(SingletonConfigurable):'
1889 1880
1890 1881 def init_readline(self):
1891 1882 """Moved to terminal subclass, here only to simplify the init logic."""
1892 self.readline = None
1893 1883 # Set a number of methods that depend on readline to be no-op
1894 self.readline_no_record = NoOpContext()
1895 self.set_readline_completer = no_op
1896 1884 self.set_custom_completer = no_op
1897 1885
1898 1886 @skip_doctest
@@ -1929,7 +1917,7 b' class InteractiveShell(SingletonConfigurable):'
1929 1917 self.Completer = IPCompleter(shell=self,
1930 1918 namespace=self.user_ns,
1931 1919 global_namespace=self.user_global_ns,
1932 use_readline=self.has_readline,
1920 use_readline=False,
1933 1921 parent=self,
1934 1922 )
1935 1923 self.configurables.append(self.Completer)
@@ -705,7 +705,6 b' python-profiler package from non-free.""")'
705 705
706 706 try:
707 707 stats = None
708 with self.shell.readline_no_record:
709 708 if 'p' in opts:
710 709 stats = self._run_with_profiler(code, opts, code_ns)
711 710 else:
@@ -343,12 +343,6 b' class InteractiveShellApp(Configurable):'
343 343 except:
344 344 self.log.warning("Unknown error in handling PYTHONSTARTUP file %s:", python_startup)
345 345 self.shell.showtraceback()
346 finally:
347 # Many PYTHONSTARTUP files set up the readline completions,
348 # but this is often at odds with IPython's own completions.
349 # Do not allow PYTHONSTARTUP to set up readline.
350 if self.shell.has_readline:
351 self.shell.set_readline_completer()
352 346
353 347 startup_files += glob.glob(os.path.join(startup_dir, '*.py'))
354 348 startup_files += glob.glob(os.path.join(startup_dir, '*.ipy'))
@@ -115,7 +115,6 b' from inspect import getsourcefile, getfile, getmodule, \\'
115 115 ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode
116 116
117 117 # IPython's own modules
118 # Modified pdb which doesn't damage IPython's readline handling
119 118 from IPython import get_ipython
120 119 from IPython.core import debugger
121 120 from IPython.core.display_trap import DisplayTrap
@@ -140,9 +140,6 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
140 140 if dummy or (dummy != 0 and self.dummy_mode):
141 141 return
142 142
143 if self.has_readline:
144 self.set_readline_completer()
145
146 143 # self.banner is auto computed
147 144 if header:
148 145 self.old_banner2 = self.banner2
General Comments 0
You need to be logged in to leave comments. Login now