Run module specified at the command-line.
(self)
| 487 | self.exit(1) |
| 488 | |
| 489 | def _run_module(self): |
| 490 | """Run module specified at the command-line.""" |
| 491 | if self.module_to_run: |
| 492 | # Make sure that the module gets a proper sys.argv as if it were |
| 493 | # run using `python -m`. |
| 494 | save_argv = sys.argv |
| 495 | sys.argv = [sys.executable] + self.extra_args |
| 496 | try: |
| 497 | self.shell.safe_run_module(self.module_to_run, |
| 498 | self.shell.user_ns) |
| 499 | finally: |
| 500 | sys.argv = save_argv |
no test coverage detected