Permalink
Browse files

Merge pull request #7 from juliantaylor/ipython-0.11

add compatibility with ipython 0.11
  • Loading branch information...
2 parents 72f4a5e + dafdd23 commit 2fb4d52af069caee629d9882d554de0136c0987e @bbangert bbangert committed Oct 4, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 pylons/commands.py
View
@@ -560,10 +560,16 @@ def command(self):
raise ImportError()
# try to use IPython if possible
- from IPython.Shell import IPShellEmbed
+ 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)
- shell = IPShellEmbed(argv=self.args)
- shell.set_banner(shell.IP.BANNER + '\n\n' + banner)
try:
shell(local_ns=locs, global_ns={})
finally:

0 comments on commit 2fb4d52

Please sign in to comment.