[bluec0re] Make ipython_view compatible to version >= 1.0. Fixes #7868
This commit is contained in:
parent
89347ffdd9
commit
818a403a3f
|
@ -92,6 +92,9 @@ class IterableIPShell:
|
|||
@type input_func: function
|
||||
"""
|
||||
if input_func:
|
||||
if IPython.version_info[0] >= 1:
|
||||
IPython.terminal.interactiveshell.raw_input_original = input_func
|
||||
else:
|
||||
IPython.frontend.terminal.interactiveshell.raw_input_original = input_func
|
||||
if cin:
|
||||
IPython.utils.io.stdin = IPython.utils.io.IOStream(cin)
|
||||
|
@ -112,6 +115,9 @@ class IterableIPShell:
|
|||
cfg = Config()
|
||||
cfg.InteractiveShell.colors = "Linux"
|
||||
|
||||
if IPython.version_info[0] >= 1:
|
||||
self.IP = IPython.terminal.embed.InteractiveShellEmbed(config=cfg, user_ns=user_ns)
|
||||
else:
|
||||
self.IP = IPython.frontend.terminal.embed.InteractiveShellEmbed(config=cfg, user_ns=user_ns)
|
||||
self.IP.system = lambda cmd: self.shell(self.IP.var_expand(cmd),
|
||||
header='IPython system call: ',
|
||||
|
|
Loading…
Reference in New Issue