Commits

Yoko Toka  committed e6d85b2

Add compatibility with ipython>=0.11

Try to use 0.11 and 0.10 api to open embedded ipython shell

  • Participants
  • Parent commits 5348821

Comments (0)

Files changed (1)

File pylons/commands.py

                 raise ImportError()
 
             # try to use IPython if possible
-            from IPython.Shell import IPShellEmbed
-
-            shell = IPShellEmbed(argv=self.args)
-            shell.set_banner(shell.IP.BANNER + '\n\n' + banner)
+            try:
+                # ipython >= 0.11
+                from IPython.frontend.terminal.embed import InteractiveShellEmbed
+                shell = InteractiveShellEmbed(banner2=banner)
+            except ImportError:
+                # ipython < 0.11
+                from IPython.Shell import IPShellEmbed
+                shell = IPShellEmbed(argv=self.args)
+                shell.set_banner(shell.IP.BANNER + '\n\n' + banner)            
+            
             try:
                 shell(local_ns=locs, global_ns={})
             finally: