##// END OF EJS Templates
irunner use python -m IPython to launch subprocess with matching interpreter...
Thomas Kluyver -
Show More
@@ -287,7 +287,6 b' class InteractiveRunner(object):'
287 287
288 288 self.run_file(args[0],opts.interact)
289 289
290 _ipython_cmd = "ipython3" if py3compat.PY3 else "ipython"
291 290
292 291 # Specific runners for particular programs
293 292 class IPythonRunner(InteractiveRunner):
@@ -303,15 +302,20 b' class IPythonRunner(InteractiveRunner):'
303 302 prompts would break this.
304 303 """
305 304
306 def __init__(self,program = _ipython_cmd, args=None, out=sys.stdout, echo=True):
305 def __init__(self, program='<ipython>', args=None, out=sys.stdout, echo=True):
307 306 """New runner, optionally passing the ipython command to use."""
308 307 args0 = ['--colors=NoColor',
309 308 '--no-term-title',
310 309 '--no-autoindent',
311 310 # '--quick' is important, to prevent loading default config:
312 311 '--quick']
313 if args is None: args = args0
314 else: args = args0 + args
312 args = args0 + (args or [])
313
314 # Special case to launch IPython with current interpreter
315 if program == '<ipython>':
316 program = sys.executable
317 args = ['-m', 'IPython'] + args
318
315 319 prompts = [r'In \[\d+\]: ',r' \.*: ']
316 320 InteractiveRunner.__init__(self,program,prompts,args,out,echo)
317 321
General Comments 0
You need to be logged in to leave comments. Login now