Skip to content

Commit

Permalink
Merge pull request scrapy#856 from eliasdorneles/fix-embed-ipython-shell
Browse files Browse the repository at this point in the history
fix IPython shell scope issue by using IPython.embed()
  • Loading branch information
kmike committed Aug 19, 2014
2 parents 8360380 + 6f50cf5 commit c4f9e9d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scrapy/utils/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4f9e9d

Please sign in to comment.