Skip to content
Permalink
Browse files

fix IPython shell scope issue and load IPython user config

  • Loading branch information
eliasdorneles authored and dangra committed Apr 20, 2015
1 parent c84c376 commit 2c8e573a067b609cab5c89088871e6892d15e251
Showing with 8 additions and 8 deletions.
  1. +8 −8 scrapy/utils/console.py
@@ -13,16 +13,16 @@ def start_python_console(namespace=None, noipython=False, banner=''):
raise ImportError()

try:
try:
from IPython.terminal import embed
except ImportError:
from IPython.frontend.terminal import embed
sh = embed.InteractiveShellEmbed(banner1=banner)
from IPython.terminal.embed import InteractiveShellEmbed
from IPython.terminal.ipapp import load_default_config
except ImportError:
from IPython.Shell import IPShellEmbed
sh = IPShellEmbed(banner=banner)
from IPython.frontend.terminal.embed import InteractiveShellEmbed
from IPython.frontend.terminal.ipapp import load_default_config

sh(global_ns={}, local_ns=namespace)
config = load_default_config()
shell = InteractiveShellEmbed(
banner1=banner, user_ns=namespace, config=config)
shell()
except ImportError:
import code
try: # readline module is only available on unix systems

0 comments on commit 2c8e573

Please sign in to comment.