Skip to content

Commit 733e5f7

Browse files
committed
button: raise from parent exception
This fixes a PyLint warning: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
1 parent db9029d commit 733e5f7

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)