MCPcopy Create free account
hub / github.com/ipython/ipython / _run_module

Method _run_module

IPython/core/shellapp.py:430–441  ·  view source on GitHub ↗

Run module specified at the command-line.

(self)

Source from the content-addressed store, hash-verified

428 self.exit(1)
429
430 def _run_module(self):
431 """Run module specified at the command-line."""
432 if self.module_to_run:
433 # Make sure that the module gets a proper sys.argv as if it were
434 # run using `python -m`.
435 save_argv = sys.argv
436 sys.argv = [sys.executable] + self.extra_args
437 try:
438 self.shell.safe_run_module(self.module_to_run,
439 self.shell.user_ns)
440 finally:
441 sys.argv = save_argv

Callers 1

init_codeMethod · 0.95

Calls 1

safe_run_moduleMethod · 0.80

Tested by

no test coverage detected