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

Method run

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

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

Callers 15

runctxMethod · 0.95
asyncbrowser.pyFile · 0.45
benchFunction · 0.45
_runmoduleMethod · 0.45
_runscriptMethod · 0.45
runFunction · 0.45
testFunction · 0.45
runFunction · 0.45
scan_modulesFunction · 0.45
whats_left.pyFile · 0.45
run_testFunction · 0.45
get_cpython_versionFunction · 0.45

Calls 6

resetMethod · 0.95
start_traceMethod · 0.95
stop_traceMethod · 0.95
isinstanceFunction · 0.85
compileFunction · 0.70
execFunction · 0.50

Tested by 1

benchFunction · 0.36