MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / run

Method run

tools/python-3.11.9-amd64/Lib/bdb.py:585–605  ·  view source on GitHub ↗

Debug a statement executed via the exec() function. globals defaults to __main__.dict; locals defaults to globals.

(self, cmd, globals=None, locals=None)

Source from the content-addressed store, hash-verified

583 # Both can be given as a string, or a code object.
584
585 def run(self, cmd, globals=None, locals=None):
586 """Debug a statement executed via the exec() function.
587
588 globals defaults to __main__.dict; locals defaults to globals.
589 """
590 if globals is None:
591 import __main__
592 globals = __main__.__dict__
593 if locals is None:
594 locals = globals
595 self.reset()
596 if isinstance(cmd, str):
597 cmd = compile(cmd, "<string>", "exec")
598 sys.settrace(self.trace_dispatch)
599 try:
600 exec(cmd, globals, locals)
601 except BdbQuit:
602 pass
603 finally:
604 self.quitting = True
605 sys.settrace(None)
606
607 def runeval(self, expr, globals=None, locals=None):
608 """Debug an expression executed via the eval() function.

Callers 4

runctxMethod · 0.95
_runMethod · 0.45
runFunction · 0.45
testFunction · 0.45

Calls 2

resetMethod · 0.95
compileFunction · 0.70

Tested by

no test coverage detected