Permalink
Browse files

Merge branch 'development' of https://github.com/TurboGears/tg2devtools

… into development
  • Loading branch information...
2 parents 31a3398 + 52ad78d commit 20b17aa0f85c724a3a5d9efe4912403e6d30f730 @amol- amol- committed May 27, 2017
Showing with 8 additions and 4 deletions.
  1. +8 −4 devtools/gearbox/tgshell.py
@@ -117,16 +117,20 @@ def _run_shell(self, base_module, locs, disable_ipython):
# try to use IPython if possible
try:
- # ipython >= 0.11
- from IPython.frontend.terminal.embed import InteractiveShellEmbed
- shell = InteractiveShellEmbed(banner2=banner)
+ try:
+ # ipython >= 1.0
+ from IPython.terminal.embed import InteractiveShellEmbed
+ except ImportError:
+ # ipython >= 0.11
+ from IPython.frontend.terminal.embed import InteractiveShellEmbed
+ shell = InteractiveShellEmbed.instance(banner2=banner)
except ImportError:
# ipython < 0.11
from IPython.Shell import IPShellEmbed
shell = IPShellEmbed()
shell.set_banner(shell.IP.BANNER + '\n\n' + banner)
- shell(local_ns=locs, global_ns={})
+ shell(local_ns=locs)
except ImportError:
import code
py_prefix = sys.platform.startswith('java') and 'J' or 'P'

0 comments on commit 20b17aa

Please sign in to comment.