Skip to content

Commit e3e4c24

Browse files
committed
use getattr
1 parent 70db215 commit e3e4c24

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

adafruit_button/button_base.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ def __init__(
7878
@property
7979
def label(self):
8080
"""The text label of the button"""
81-
if self._label is not None and hasattr(self._label, "text"):
82-
return self._label.text
83-
return None
81+
return getattr(self._label, "text", None)
8482

8583
@label.setter
8684
def label(self, newtext):

0 commit comments

Comments
 (0)