Skip to content

Commit 5a3cc7c

Browse files
committed
Chain the errors
1 parent f3bfd6d commit 5a3cc7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_motor/stepper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ def __init__(
116116
if self._coil[i].frequency < 1500:
117117
try:
118118
self._coil[i].frequency = 2000
119-
except AttributeError:
119+
except AttributeError as err:
120120
raise ValueError(
121121
"PWMOut outputs must either be set to at least "
122122
"1500 Hz or allow variable frequency."
123-
)
123+
) from err
124124
if microsteps < 2:
125125
raise ValueError("Microsteps must be at least 2")
126126
if microsteps % 2 == 1:

0 commit comments

Comments
 (0)