mirror of https://github.com/scrapy/scrapy.git
fix start_python_console() to work with IPython >= 0.11. closes #335
This commit is contained in:
parent
18cb4ff1d8
commit
3191a08560
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue