Skip to content

Commit

Permalink
fix null error from label property / resize
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed Oct 26, 2024
1 parent 3c36a11 commit 70db215
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/pylint
rev: v2.17.4
rev: v3.3.1
hooks:
- id: pylint
name: pylint (library code)
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ valid-metaclass-classmethod-first-arg=mcs
[DESIGN]

# Maximum number of arguments for function / method
max-args=5
max-args=18

# Maximum number of attributes for a class (see R0902).
# max-attributes=7
Expand Down
4 changes: 3 additions & 1 deletion adafruit_button/button_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def __init__(
@property
def label(self):
"""The text label of the button"""
return self._label.text
if self._label is not None and hasattr(self._label, "text"):
return self._label.text
return None

@label.setter
def label(self, newtext):
Expand Down

0 comments on commit 70db215

Please sign in to comment.