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

Avoid UnboundLocalError in drag_pan. #10492

Merged
merged 1 commit into from
Feb 16, 2018
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 16, 2018

Axes.drag_pan should probably have been private but it's public and
should therefore properly handle unexpected input, as exposed in #9772.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Axes.drag_pan should probably have been private but it's public and
should therefore properly handle unexpected input.
@anntzer anntzer added this to the v3.0 milestone Feb 16, 2018
@@ -4014,7 +4014,7 @@ def format_deltas(key, dx, dy):
p = self._pan_start
dx = x - p.x
dy = y - p.y
if dx == 0 and dy == 0:
if dx == dy == 0:
Copy link
Member

Choose a reason for hiding this comment

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

Oh, cool. I didn't realize you could do that with equals. I just always thought it was a special case in the interpreter for the < and > to do "between" tests.

@dstansby dstansby merged commit 3c70841 into matplotlib:master Feb 16, 2018
@anntzer anntzer deleted the drag-pan branch February 16, 2018 22:37
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.

3 participants