Show More
@@ -62,7 +62,6 b' from IPython.utils import PyColorize' | |||||
62 | from IPython.utils import io |
|
62 | from IPython.utils import io | |
63 | from IPython.utils import py3compat |
|
63 | from IPython.utils import py3compat | |
64 | from IPython.utils import openpy |
|
64 | from IPython.utils import openpy | |
65 | from IPython.utils.contexts import NoOpContext |
|
|||
66 | from IPython.utils.decorators import undoc |
|
65 | from IPython.utils.decorators import undoc | |
67 | from IPython.utils.io import ask_yes_no |
|
66 | from IPython.utils.io import ask_yes_no | |
68 | from IPython.utils.ipstruct import Struct |
|
67 | from IPython.utils.ipstruct import Struct | |
@@ -574,9 +573,6 b' class InteractiveShell(SingletonConfigurable):' | |||||
574 | self.tempfiles = [] |
|
573 | self.tempfiles = [] | |
575 | self.tempdirs = [] |
|
574 | self.tempdirs = [] | |
576 |
|
575 | |||
577 | # Keep track of readline usage (later set by init_readline) |
|
|||
578 | self.has_readline = False |
|
|||
579 |
|
||||
580 | # keep track of where we started running (mainly for crash post-mortem) |
|
576 | # keep track of where we started running (mainly for crash post-mortem) | |
581 | # This is not being used anywhere currently. |
|
577 | # This is not being used anywhere currently. | |
582 | self.starting_dir = py3compat.getcwd() |
|
578 | self.starting_dir = py3compat.getcwd() | |
@@ -659,9 +655,6 b' class InteractiveShell(SingletonConfigurable):' | |||||
659 | # override sys.stdout and sys.stderr themselves, you need to do that |
|
655 | # override sys.stdout and sys.stderr themselves, you need to do that | |
660 | # *before* instantiating this class, because io holds onto |
|
656 | # *before* instantiating this class, because io holds onto | |
661 | # references to the underlying streams. |
|
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 | error('No traceback has been produced, nothing to debug.') |
|
977 | error('No traceback has been produced, nothing to debug.') | |
985 | return |
|
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 | def init_readline(self): |
|
1881 | def init_readline(self): | |
1891 | """Moved to terminal subclass, here only to simplify the init logic.""" |
|
1882 | """Moved to terminal subclass, here only to simplify the init logic.""" | |
1892 | self.readline = None |
|
|||
1893 | # Set a number of methods that depend on readline to be no-op |
|
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 | self.set_custom_completer = no_op |
|
1884 | self.set_custom_completer = no_op | |
1897 |
|
1885 | |||
1898 | @skip_doctest |
|
1886 | @skip_doctest | |
@@ -1929,7 +1917,7 b' class InteractiveShell(SingletonConfigurable):' | |||||
1929 | self.Completer = IPCompleter(shell=self, |
|
1917 | self.Completer = IPCompleter(shell=self, | |
1930 | namespace=self.user_ns, |
|
1918 | namespace=self.user_ns, | |
1931 | global_namespace=self.user_global_ns, |
|
1919 | global_namespace=self.user_global_ns, | |
1932 |
use_readline= |
|
1920 | use_readline=False, | |
1933 | parent=self, |
|
1921 | parent=self, | |
1934 | ) |
|
1922 | ) | |
1935 | self.configurables.append(self.Completer) |
|
1923 | self.configurables.append(self.Completer) |
@@ -705,7 +705,6 b' python-profiler package from non-free.""")' | |||||
705 |
|
705 | |||
706 | try: |
|
706 | try: | |
707 | stats = None |
|
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 | except: |
|
343 | except: | |
344 | self.log.warning("Unknown error in handling PYTHONSTARTUP file %s:", python_startup) |
|
344 | self.log.warning("Unknown error in handling PYTHONSTARTUP file %s:", python_startup) | |
345 | self.shell.showtraceback() |
|
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 | startup_files += glob.glob(os.path.join(startup_dir, '*.py')) |
|
347 | startup_files += glob.glob(os.path.join(startup_dir, '*.py')) | |
354 | startup_files += glob.glob(os.path.join(startup_dir, '*.ipy')) |
|
348 | startup_files += glob.glob(os.path.join(startup_dir, '*.ipy')) |
@@ -115,7 +115,6 b' from inspect import getsourcefile, getfile, getmodule, \\' | |||||
115 | ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode |
|
115 | ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode | |
116 |
|
116 | |||
117 | # IPython's own modules |
|
117 | # IPython's own modules | |
118 | # Modified pdb which doesn't damage IPython's readline handling |
|
|||
119 | from IPython import get_ipython |
|
118 | from IPython import get_ipython | |
120 | from IPython.core import debugger |
|
119 | from IPython.core import debugger | |
121 | from IPython.core.display_trap import DisplayTrap |
|
120 | from IPython.core.display_trap import DisplayTrap |
@@ -140,9 +140,6 b' class InteractiveShellEmbed(TerminalInteractiveShell):' | |||||
140 | if dummy or (dummy != 0 and self.dummy_mode): |
|
140 | if dummy or (dummy != 0 and self.dummy_mode): | |
141 | return |
|
141 | return | |
142 |
|
142 | |||
143 | if self.has_readline: |
|
|||
144 | self.set_readline_completer() |
|
|||
145 |
|
||||
146 | # self.banner is auto computed |
|
143 | # self.banner is auto computed | |
147 | if header: |
|
144 | if header: | |
148 | self.old_banner2 = self.banner2 |
|
145 | self.old_banner2 = self.banner2 |
General Comments 0
You need to be logged in to leave comments.
Login now