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

Clarify loading of backend FigureCanvas and show(). #26665

Merged
merged 1 commit into from Sep 1, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 31, 2023

  • FigureCanvas is now required to exist on backend modules (since the deprecation elapsed in 3.8) and we indeed already access that attribute directly when checking required_interactive_framework, so remove redundant getattrs.
  • Clarify the error message when manager_class is None and there's no global show(). (Previously an AttributeError would be raised: [Bug]: 'NoneType' object has no attribute 'pyplot_show' #26463)

PR summary

PR checklist

if not manager_pyplot_show:
raise ValueError(
"Backend `newbackend` defines neither `FigureCanvas.manager_class` nor "
"a toplevel `show` function")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am missing something obvious (or do not see properly), but do we use backticks in error messages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed them.

lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
- FigureCanvas is now required to exist on backend modules (since the
  deprecation elapsed in 3.8) and we indeed already access that
  attribute directly when checking required_interactive_framework, so
  remove redundant getattrs.
- Clarify the error message when manager_class is None *and* there's no
  global show().  (Previously an AttributeError would be raised.)
@timhoffm timhoffm added this to the v3.8.0 milestone Sep 1, 2023
@timhoffm timhoffm merged commit 469b96b into matplotlib:main Sep 1, 2023
40 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 1, 2023
@anntzer anntzer deleted the cc branch September 1, 2023 12:58
QuLogic added a commit that referenced this pull request Sep 1, 2023
…665-on-v3.8.x

Backport PR #26665 on branch v3.8.x (Clarify loading of backend FigureCanvas and show().)
@ksunden ksunden mentioned this pull request Sep 15, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants