summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-06-14 23:24:46 -0700
committerNathan Binkert <nate@binkert.org>2010-06-14 23:24:46 -0700
commit5fc7adcba05dd3c732758d18f03db090ac17fbb9 (patch)
tree93f75a3bac21efaa86703f371e620bd8a5e61d96 /src
parent70497d6a18aedb41361a1726a01ced4abd5daabf (diff)
downloadgem5-5fc7adcba05dd3c732758d18f03db090ac17fbb9.tar.xz
python: use ipython in --interactive if it is available
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/main.py9
1 files changed, 7 insertions, 2 deletions
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