Run module specified at the command-line.
(self)
| 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 |
no test coverage detected