python: Get rid of ipython 0.10 and older support code.
Version 0.11 was actually the first version of ipython which even supported python 3 at all, as far as I can tell. Because we have a requirement to use at least python 3 (and not just 3.0 at that), we can assume that the user must be using at least version 0.11 of ipython. That means we can remove code which supported older versions. Change-Id: I7f88aae9f64f6c6f027be52741cda0686f5ca5be Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50709 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -172,30 +172,19 @@ def interact(scope):
|
||||
prompt_in1 = "gem5 \\#> "
|
||||
prompt_out = "gem5 \\#: "
|
||||
|
||||
# Is IPython version 0.10 or earlier available?
|
||||
try:
|
||||
from IPython.Shell import IPShellEmbed
|
||||
ipshell = IPShellEmbed(argv=["-prompt_in1", prompt_in1,
|
||||
"-prompt_out", prompt_out],
|
||||
banner=banner, user_ns=scope)
|
||||
import IPython
|
||||
from IPython.config.loader import Config
|
||||
from IPython.terminal.embed import InteractiveShellEmbed
|
||||
|
||||
cfg = Config()
|
||||
cfg.PromptManager.in_template = prompt_in1
|
||||
cfg.PromptManager.out_template = prompt_out
|
||||
ipshell = InteractiveShellEmbed(config=cfg, user_ns=scope,
|
||||
banner1=banner)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Is IPython version 0.11 or later available?
|
||||
if not ipshell:
|
||||
try:
|
||||
import IPython
|
||||
from IPython.config.loader import Config
|
||||
from IPython.terminal.embed import InteractiveShellEmbed
|
||||
|
||||
cfg = Config()
|
||||
cfg.PromptManager.in_template = prompt_in1
|
||||
cfg.PromptManager.out_template = prompt_out
|
||||
ipshell = InteractiveShellEmbed(config=cfg, user_ns=scope,
|
||||
banner1=banner)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if ipshell:
|
||||
ipshell()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user