Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor post-execute fixes (#1154) #1155

Merged
merged 3 commits into from Dec 15, 2011
Merged

minor post-execute fixes (#1154) #1155

merged 3 commits into from Dec 15, 2011

Conversation

minrk
Copy link
Member

@minrk 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

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.
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
Copy link
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
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
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 ipython#1154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We should be less aggressive in de-registering post-execution functions
2 participants