Skip to content

Commit

Permalink
MNT : pep8 + pyflake changes
Browse files Browse the repository at this point in the history
 - strip white space
 - rearrange 'not's
  • Loading branch information
tacaswell authored and blink1073 committed Nov 12, 2014
1 parent 51c70f0 commit d711940
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def ignore(self, event):
# Only do rectangle selection if event was triggered
# with a desired button
if self.validButtons is not None:
if not event.button in self.validButtons:
if event.button not in self.validButtons:
return True

# If no button was pressed yet ignore the event if it was out
Expand All @@ -1164,7 +1164,7 @@ def ignore(self, event):
return event.inaxes != self.ax

# If a button was pressed, check if the release-button is the
# same.
# same.
if event.button == self.eventpress.button:
return False

Expand Down Expand Up @@ -1217,7 +1217,7 @@ def press(self, event):

def release(self, event):
"""Button release event"""
if not self.ignore(event) and not self.eventpress is None:
if not self.ignore(event) and self.eventpress is not None:
self.eventrelease = copy.copy(event)
self.eventrelease.xdata, self.eventrelease.ydata = (
self._get_data(event))
Expand Down

0 comments on commit d711940

Please sign in to comment.