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

Method run

Lib/bdb.py:889–909  ·  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

887 # Both can be given as a string, or a code object.
888
889 def run(self, cmd, globals=None, locals=None):
890 """Debug a statement executed via the exec() function.
891
892 globals defaults to __main__.dict; locals defaults to globals.
893 """
894 if globals is None:
895 import __main__
896 globals = __main__.__dict__
897 if locals is None:
898 locals = globals
899 self.reset()
900 if isinstance(cmd, str):
901 cmd = compile(cmd, "<string>", "exec")
902 self.start_trace()
903 try:
904 exec(cmd, globals, locals)
905 except BdbQuit:
906 pass
907 finally:
908 self.quitting = True
909 self.stop_trace()
910
911 def runeval(self, expr, globals=None, locals=None):
912 """Debug an expression executed via the eval() function.

Callers 12

runctxMethod · 0.95
runFunction · 0.45
android_envFunction · 0.45
mainFunction · 0.45
calculate_node_pathFunction · 0.45
runFunction · 0.45
xcode_testFunction · 0.45
build_python_is_pydebugFunction · 0.45
_runMethod · 0.45
runFunction · 0.45
testFunction · 0.45

Calls 4

resetMethod · 0.95
start_traceMethod · 0.95
stop_traceMethod · 0.95
compileFunction · 0.70

Tested by

no test coverage detected