Skip to content

Commit e7b12c1

Browse files
committed
Reformatted per pre-commit
1 parent cf3f0f7 commit e7b12c1

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

adafruit_bus_device/i2c_device.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,17 @@ def write_then_readinto(
140140

141141
# pylint: enable-msg=too-many-arguments
142142

143-
def __enter__(self) -> 'I2CDevice':
143+
def __enter__(self) -> "I2CDevice":
144144
while not self.i2c.try_lock():
145145
pass
146146
return self
147147

148-
def __exit__(self, exc_type: Optional[Type[type]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> bool:
148+
def __exit__(
149+
self,
150+
exc_type: Optional[Type[type]],
151+
exc_val: Optional[BaseException],
152+
exc_tb: Optional[TracebackType],
153+
) -> bool:
149154
self.i2c.unlock()
150155
return False
151156

adafruit_bus_device/spi_device.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def __enter__(self) -> SPI:
9494
self.chip_select.value = self.cs_active_value
9595
return self.spi
9696

97-
def __exit__(self, exc_type: Optional[Type[type]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> bool:
97+
def __exit__(
98+
self,
99+
exc_type: Optional[Type[type]],
100+
exc_val: Optional[BaseException],
101+
exc_tb: Optional[TracebackType],
102+
) -> bool:
98103
if self.chip_select:
99104
self.chip_select.value = not self.cs_active_value
100105
if self.extra_clocks > 0:

0 commit comments

Comments
 (0)