##// END OF EJS Templates
try to avoid using ptk in subprocess tests
Matthias Bussonnier -
Show More
@@ -20,6 +20,11 b' from prompt_toolkit import __version__ as ptk_version'
20 20 PTK3 = ptk_version.startswith('3.')
21 21
22 22
23 # we want to avoid ptk as much as possible when using subprocesses
24 # as it uses cursor positioning requests, deletes color ....
25 _use_simple_prompt = "IPY_TEST_SIMPLE_PROMPT" in os.environ
26
27
23 28 class TerminalPdb(Pdb):
24 29 """Standalone IPython debugger."""
25 30
@@ -87,6 +92,7 b' class TerminalPdb(Pdb):'
87 92 if not PTK3:
88 93 options['inputhook'] = self.shell.inputhook
89 94 options.update(pt_session_options)
95 if not _use_simple_prompt:
90 96 self.pt_loop = asyncio.new_event_loop()
91 97 self.pt_app = PromptSession(**options)
92 98
@@ -121,10 +127,15 b' class TerminalPdb(Pdb):'
121 127 self._ptcomp.ipy_completer.global_namespace = self.curframe.f_globals
122 128
123 129 # Run the prompt in a different thread.
130 if not _use_simple_prompt:
124 131 try:
125 line = self.thread_executor.submit(self.pt_app.prompt).result()
132 line = self.thread_executor.submit(
133 self.pt_app.prompt
134 ).result()
126 135 except EOFError:
127 136 line = "EOF"
137 else:
138 line = input("ipdb> ")
128 139
129 140 line = self.precmd(line)
130 141 stop = self.onecmd(line)
General Comments 0
You need to be logged in to leave comments. Login now