From: Nathan Binkert Date: Tue, 15 Jun 2010 06:24:46 +0000 (-0700) Subject: python: use ipython in --interactive if it is available X-Git-Tag: stable_2012_02_02~1035 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fc7adcba05dd3c732758d18f03db090ac17fbb9;p=gem5.git python: use ipython in --interactive if it is available --- diff --git a/src/python/m5/main.py b/src/python/m5/main.py index fd58ce500..cd139ccb3 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -360,8 +360,13 @@ def main(): # once the script is done if options.interactive: - interact = code.InteractiveConsole(scope) - interact.interact("M5 Interactive Console") + banner = "M5 Interactive Console" + try: + from IPython.Shell import IPShellEmbed + ipshell = IPShellEmbed(banner=banner,user_ns=scope) + ipshell() + except ImportError: + code.InteractiveConsole(scope).interact(banner) if __name__ == '__main__': from pprint import pprint