Skip to content

Commit

Permalink
style: Fix get-attr-with-constant (B009) (#4009)
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Jul 11, 2024
1 parent 169ca9b commit ff453d2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gui/wxpython/modules/colorrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1901,12 +1901,12 @@ def _columnWidgetEvtHandler(self, bind=True):
]
for widget in widgets:
if bind is True:
getattr(widget["widget"], "Bind")(
widget["widget"].Bind(
widget["event"],
widget["handler"],
)
else:
getattr(widget["widget"], "Unbind")(widget["event"])
widget["widget"].Unbind(widget["event"])


class ThematicVectorTable(VectorColorTable):
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ ignore = [
"B006", # mutable-argument-default
"B007", # unused-loop-control-variable
"B008", # function-call-in-default-argument
"B009", # get-attr-with-constant
"B015", # useless-comparison
"B023", # function-uses-loop-variable
"B026", # star-arg-unpacking-after-keyword-arg
Expand Down
2 changes: 1 addition & 1 deletion scripts/wxpyimgview/wxpyimgview_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def draw(self):
dc = wx.PaintDC(self)
data = app.imgbuf.reshape((app.i_height, app.i_width, 4))
data = data[::, ::, 2::-1]
fn = getattr(data, "tobytes", getattr(data, "tostring"))
fn = getattr(data, "tobytes", data.tostring)
image = wx.Image(app.i_width, app.i_height, fn())
dc.DrawBitmap(BitmapFromImage(image), x0, y0, False)

Expand Down

0 comments on commit ff453d2

Please sign in to comment.