Gabe Black has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50709
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/python/m5/main.py
1 file changed, 9 insertions(+), 20 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved
  kokoro: Regressions pass




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: 2
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to