minor post-execute fixes (#1154) #1155

Merged
merged 3 commits into from Dec 15, 2011

Conversation

Projects
None yet
2 participants
@minrk
Member

minrk commented Dec 14, 2011

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

minrk added some commits Dec 14, 2011

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.
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.
@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Dec 15, 2011

Member

Reviewed together at Berkeley, @minrk is making one tiny fix and then we'll merge.

Member

fperez commented Dec 15, 2011

Reviewed together at Berkeley, @minrk is making one tiny fix and then we'll merge.

fperez added a commit that referenced this pull request Dec 15, 2011

Merge pull request #1155 from minrk/postexec
Be less aggressive in de-registering failing post-execute functions so that normal errors don't disable them permanently.

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

@fperez fperez merged commit 2c683b7 into ipython:master Dec 15, 2011

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

Merge pull request #1155 from minrk/postexec
Be less aggressive in de-registering failing post-execute functions so that normal errors don't disable them permanently.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment