ipython/ipython — pull request #1625 by takluyver (2012-04-18 18:53:12+00:00)
Title: Fix deepreload on Python 3

As described in #1622, it seems that `imp.find_module()` on Python 3.2 imports other modules, like `io`, while running. We don't want deepreload to catch those, so this restores the original import hook for `find_module`.

It's not terribly neat, but I don't currently see a better way of doing it. Ideally, we'd just delay installing our `__import__` until after `find_module` had run, but our implementation of `__import__` can itself call `find_module`, so this little dance seems to be necessary.

Closes gh-1622, and hopefully fixes a test failure we saw last night.