ipython/ipython — pull request #1155 by minrk (2011-12-14 21:21:50+00:00)
Title: minor post-execute fixes (#1154)

Two changes:

1. Don't unregister failing post-exec callbacks automatically. Instead, print a message regarding the failure, pointing to new `disable_failing_post_execute` trait for skipping failing callbacks.
- When this flag is False (the default), failing callbacks will continue to be called.
- When True, behavior is unchanged from previous, where callbacks are only allowed to fail once.
2. protect `flush_figures()` post-exec function from user error. Invalid matplotlib data may raise inside `print_figure()`. flush_figures() is a post-exec function, so user errors should not raise. Instead, call `get_ipython().showtraceback()` if called from IPython, raising as before otherwise.

closes #1154