##// END OF EJS Templates
Override sys.argv when calling run_module.
Bradley M. Froehle -
Show More
@@ -302,4 +302,12 b' class InteractiveShellApp(Configurable):'
302 def _run_module(self):
302 def _run_module(self):
303 """Run module specified at the command-line."""
303 """Run module specified at the command-line."""
304 if self.module_to_run:
304 if self.module_to_run:
305 self.shell.safe_run_module(self.module_to_run, self.shell.user_ns)
305 # Make sure that the module gets a proper sys.argv as if it were
306 # run using `python -m`.
307 save_argv = sys.argv
308 sys.argv = [sys.executable] + self.extra_args
309 try:
310 self.shell.safe_run_module(self.module_to_run,
311 self.shell.user_ns)
312 finally:
313 sys.argv = save_argv
General Comments 0
You need to be logged in to leave comments. Login now