MCPcopy Index your code
hub / github.com/python/cpython / _run_in_python_repl

Method _run_in_python_repl

Lib/pdb.py:3025–3038  ·  view source on GitHub ↗
(self, lines)

Source from the content-addressed store, hash-verified

3023 builtins._ = obj
3024
3025 def _run_in_python_repl(self, lines):
3026 # Run one 'interact' mode code block against an existing namespace.
3027 assert self._interact_state
3028 save_displayhook = sys.displayhook
3029 try:
3030 sys.displayhook = self._interact_displayhook
3031 code_obj = self._interact_state["compiler"](lines + "\n")
3032 if code_obj is None:
3033 raise SyntaxError("Incomplete command")
3034 exec(code_obj, self._interact_state["ns"])
3035 except:
3036 self._error_exc()
3037 finally:
3038 sys.displayhook = save_displayhook
3039
3040 def do_interact(self, arg):
3041 # Prepare to run 'interact' mode code blocks, and trigger the client

Callers 2

cmdloopMethod · 0.95
test_interact_modeMethod · 0.80

Calls 1

_error_excMethod · 0.95

Tested by 1

test_interact_modeMethod · 0.64