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

Method _runmodule

Lib/pdb.py:1539–1555  ·  view source on GitHub ↗
(self, module_name)

Source from the content-addressed store, hash-verified

1537 return None
1538
1539 def _runmodule(self, module_name):
1540 self._wait_for_mainpyfile = True
1541 self._user_requested_quit = False
1542 import runpy
1543 mod_name, mod_spec, code = runpy._get_module_details(module_name)
1544 self.mainpyfile = self.canonic(code.co_filename)
1545 import __main__
1546 __main__.__dict__.clear()
1547 __main__.__dict__.update({
1548 "__name__": "__main__",
1549 "__file__": self.mainpyfile,
1550 "__package__": mod_spec.parent,
1551 "__loader__": mod_spec.loader,
1552 "__spec__": mod_spec,
1553 "__builtins__": __builtins__,
1554 })
1555 self.run(code)
1556
1557 def _runscript(self, filename):
1558 # The script has to run in __main__ namespace (or imports from

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