Show More
@@ -287,7 +287,6 b' class InteractiveRunner(object):' | |||||
287 |
|
287 | |||
288 | self.run_file(args[0],opts.interact) |
|
288 | self.run_file(args[0],opts.interact) | |
289 |
|
289 | |||
290 | _ipython_cmd = "ipython3" if py3compat.PY3 else "ipython" |
|
|||
291 |
|
290 | |||
292 | # Specific runners for particular programs |
|
291 | # Specific runners for particular programs | |
293 | class IPythonRunner(InteractiveRunner): |
|
292 | class IPythonRunner(InteractiveRunner): | |
@@ -303,15 +302,20 b' class IPythonRunner(InteractiveRunner):' | |||||
303 | prompts would break this. |
|
302 | prompts would break this. | |
304 | """ |
|
303 | """ | |
305 |
|
304 | |||
306 |
def __init__(self,program |
|
305 | def __init__(self, program='<ipython>', args=None, out=sys.stdout, echo=True): | |
307 | """New runner, optionally passing the ipython command to use.""" |
|
306 | """New runner, optionally passing the ipython command to use.""" | |
308 | args0 = ['--colors=NoColor', |
|
307 | args0 = ['--colors=NoColor', | |
309 | '--no-term-title', |
|
308 | '--no-term-title', | |
310 | '--no-autoindent', |
|
309 | '--no-autoindent', | |
311 | # '--quick' is important, to prevent loading default config: |
|
310 | # '--quick' is important, to prevent loading default config: | |
312 | '--quick'] |
|
311 | '--quick'] | |
313 | if args is None: args = args0 |
|
312 | args = args0 + (args or []) | |
314 | else: args = args0 + args |
|
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 | prompts = [r'In \[\d+\]: ',r' \.*: '] |
|
319 | prompts = [r'In \[\d+\]: ',r' \.*: '] | |
316 | InteractiveRunner.__init__(self,program,prompts,args,out,echo) |
|
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