MCPcopy Index your code
hub / github.com/RustPython/RustPython / default

Method default

Lib/pdb.py:376–396  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

374 self.message(repr(obj))
375
376 def default(self, line):
377 if line[:1] == '!': line = line[1:]
378 locals = self.curframe_locals
379 globals = self.curframe.f_globals
380 try:
381 code = compile(line + '\n', '<stdin>', 'single')
382 save_stdout = sys.stdout
383 save_stdin = sys.stdin
384 save_displayhook = sys.displayhook
385 try:
386 sys.stdin = self.stdin
387 sys.stdout = self.stdout
388 sys.displayhook = self.displayhook
389 exec(code, globals, locals)
390 finally:
391 sys.stdout = save_stdout
392 sys.stdin = save_stdin
393 sys.displayhook = save_displayhook
394 except:
395 exc_info = sys.exc_info()[:2]
396 self.error(traceback.format_exception_only(*exc_info)[-1].strip())
397
398 def precmd(self, line):
399 """Handle alias expansion and ';;' separator."""

Callers

nothing calls this directly

Calls 5

errorMethod · 0.95
format_exception_onlyMethod · 0.80
compileFunction · 0.70
execFunction · 0.50
stripMethod · 0.45

Tested by

no test coverage detected