Skip to content

Fix singleshot timers in wx. #18621

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

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Oct 1, 2020

PR Summary

TimerWx._timer_set_single_shot currently tries to start the timer without interval or any other setting, which is not what this method is supposed to do; it should only modify settings on internal objects. Since single shot mode is fully handled in TimerWx._timer_start, this method is unnecessary.

Fixes #18620.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and pydocstyle<4 and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

`TimerWx._timer_set_single_shot` currently tries to start the timer
without interval or any other setting, which is not what this method is
supposed to do; it should only modify settings on internal objects.
Since single shot mode is fully handled in `TimerWx._timer_start`, this
method is unnecessary.
@tacaswell tacaswell merged commit ca45dad into matplotlib:master Oct 1, 2020
@QuLogic QuLogic deleted the wx-singleshot-timer branch October 1, 2020 20:06
@gonesurfing
Copy link

Can confirm, this fixes the issue. Thanks!

@tacaswell
Copy link
Member

This is a 3.3 regression, should be backported?

@QuLogic
Copy link
Member Author

QuLogic commented Oct 2, 2020

Did something else change in how timers worked? That wx code has been there much much longer than 3.3.

@QuLogic
Copy link
Member Author

QuLogic commented Oct 2, 2020

Ah, looks like #17160 started using the setter on __init__.

@meeseeksdev backport to v3.3.x

@QuLogic QuLogic modified the milestones: v3.4.0, v3.3.3 Oct 2, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Oct 2, 2020
QuLogic added a commit that referenced this pull request Oct 2, 2020
…621-on-v3.3.x

Backport PR #18621 on branch v3.3.x (Fix singleshot timers in wx.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wx backend assertion error with fig.canvas.timer.start()
4 participants