Skip to content

Commit ee4a2ac

Browse files
committed
Added type hints for Servo.__exit__()
1 parent 6df9971 commit ee4a2ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_motor/servo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"""
1414

1515
try:
16-
from typing import Optional
16+
from typing import Optional, Type
17+
from types import TracebackType
1718
from pwmio import PWMOut
1819
except ImportError:
1920
pass
@@ -140,5 +141,5 @@ def throttle(self, value: float):
140141
def __enter__(self):
141142
return self
142143

143-
def __exit__(self, exception_type, exception_value, traceback):
144+
def __exit__(self, exception_type: Optional[Type[type]], exception_value: Optional[BaseException], traceback: Optional[TracebackType]):
144145
self.throttle = 0

0 commit comments

Comments
 (0)