Skip to content

Commit f68d621

Browse files
authored
Merge pull request #25 from ktdreyer/button-packet-length
button: raise from parent exception
2 parents db9029d + 733e5f7 commit f68d621

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_bluefruit_connect/button_packet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def __init__(self, button, pressed):
7171
# This check will catch wrong length and also non-sequence args (like an int).
7272
try:
7373
assert len(button) == 1
74-
except:
75-
raise ValueError("Button must be a single char or byte.")
74+
except Exception as err:
75+
raise ValueError("Button must be a single char or byte.") from err
7676

7777
self._button = button
7878
self._pressed = pressed

0 commit comments

Comments
 (0)