From 3191a0856003e8298d9d4b74aec56ffb5ed38432 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Tue, 2 Aug 2011 22:45:51 -0300 Subject: [PATCH] fix start_python_console() to work with IPython >= 0.11. closes #335 --- scrapy/utils/console.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scrapy/utils/console.py b/scrapy/utils/console.py index 9edf36e39..c376ed059 100644 --- a/scrapy/utils/console.py +++ b/scrapy/utils/console.py @@ -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