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

Method _run

tools/python-3.11.9-amd64/Lib/pdb.py:1625–1643  ·  view source on GitHub ↗
(self, target: Union[_ModuleTarget, _ScriptTarget])

Source from the content-addressed store, hash-verified

1623 return None
1624
1625 def _run(self, target: Union[_ModuleTarget, _ScriptTarget]):
1626 # When bdb sets tracing, a number of call and line events happen
1627 # BEFORE debugger even reaches user's code (and the exact sequence of
1628 # events depends on python version). Take special measures to
1629 # avoid stopping before reaching the main script (see user_line and
1630 # user_call for details).
1631 self._wait_for_mainpyfile = True
1632 self._user_requested_quit = False
1633
1634 self.mainpyfile = self.canonic(target.filename)
1635
1636 # The target has to run in __main__ namespace (or imports from
1637 # __main__ will break). Clear __main__ and replace with
1638 # the target namespace.
1639 import __main__
1640 __main__.__dict__.clear()
1641 __main__.__dict__.update(target.namespace)
1642
1643 self.run(target.code)
1644
1645 def _format_exc(self, exc: BaseException):
1646 return traceback.format_exception_only(exc)[-1].strip()

Callers 1

mainFunction · 0.95

Calls 4

canonicMethod · 0.80
clearMethod · 0.45
updateMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected