fix start_python_console() to work with IPython >= 0.11. closes #335

This commit is contained in:
Pablo Hoffman 2011-08-02 22:45:51 -03:00
parent 18cb4ff1d8
commit 3191a08560
1 changed files with 4 additions and 1 deletions

View File

@ -11,7 +11,10 @@ def start_python_console(namespace=None, noipython=False):
if noipython:
raise ImportError
import IPython
shell = IPython.Shell.IPShellEmbed(argv=[], user_ns=namespace)
try:
shell = IPython.embed(user_ns=namespace)
except AttributeError:
shell = IPython.Shell.IPShellEmbed(argv=[], user_ns=namespace)
shell()
except ImportError:
import code