Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Avoid IPython warning. thanks @bryant1410. closes #623

Daniel Graña1c9effd7b487
diff --git a/scrapy/utils/console.py b/scrapy/utils/console.py
index 25782d512..5dd4539ed 100644
--- a/scrapy/utils/console.py
+++ b/scrapy/utils/console.py
@@ -13,8 +13,11 @@ def start_python_console(namespace=None, noipython=False, banner=''):
raise ImportError()
try:
- from IPython.frontend.terminal.embed import InteractiveShellEmbed
- sh = InteractiveShellEmbed(banner1=banner)
+ try:
+ from IPython.terminal import embed
+ except ImportError:
+ from IPython.frontend.terminal import embed
+ sh = embed.InteractiveShellEmbed(banner1=banner)
except ImportError:
from IPython.Shell import IPShellEmbed
sh = IPShellEmbed(banner=banner)