scrapy/scrapy — pull request #856 by eliasdorneles (2014-08-14 00:58:02+00:00)
Title: fix IPython shell scope issue by using IPython.embed()

Hey folks,

So, this is my attempt to fix issue #794.
I discovered that using `IPython.embed` function handles the scoping correctly.
Plus, it will also respect the configuration in the IPython's user default profile.

To verify the change of behavior, this was my test:

```
>>> a = 1
>>> (lambda: a)()
1
```

Before the changes:

```
$ scrapy shell
....
In [1]: a = 1

In [2]: (lambda: a)()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in ()
----> 1 (lambda: a)()

in ()
----> 1 (lambda: a)()

NameError: global name 'a' is not defined
```

After the changes:

```
scrapy shell
....
>>> a = 1
>>> (lambda: a)()
1
```
Note how in this session IPython loads using the ">>> " prompt I've configured in my user profile.

Does this look OK?