diff -r 9b9cd17a0791 -r 94d729400c72 src/python/m5/main.py --- a/src/python/m5/main.py Tue Dec 21 08:24:23 2010 -0800 +++ b/src/python/m5/main.py Tue Dec 21 08:25:13 2010 -0800 @@ -130,6 +130,16 @@ arguments = options.parse_args() +def interact(scope): + banner = "M5 Interactive Console" + sys.argv = [] + try: + from IPython.Shell import IPShellEmbed + ipshell = IPShellEmbed(banner=banner,user_ns=scope) + ipshell() + except ImportError: + code.InteractiveConsole(scope).interact(banner) + def main(): import core import debug @@ -355,13 +365,7 @@ # once the script is done if options.interactive: - 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) + interact(scope) if __name__ == '__main__': from pprint import pprint