Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/50709 )
Change subject: python: Get rid of ipython 0.10 and older support code.
......................................................................
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
---
M src/python/m5/main.py
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index b81da7a..f649e77 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -172,30 +172,19 @@
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:
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50709
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I7f88aae9f64f6c6f027be52741cda0686f5ca5be
Gerrit-Change-Number: 50709
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s