ipython/ipython — pull request #997 by minrk (2011-11-13 23:47:57+00:00)
Title: don't unregister interrupted post-exec functions

only unregister on real Exceptions.

also put close/cleanup for the inline backend calls inside `finally` block,
to ensure that the state is clean on the next round, even if show/flush is interrupted

closes gh-992