Skip to content

Commit c6e7954

Browse files
committed
Circuitpython requires this or it type-errors
1 parent 2e653c0 commit c6e7954

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

adafruit_bus_device/i2c_device.py

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def write_then_readinto(self, out_buffer, in_buffer, *,
128128
:param int in_end: Index to write up to but not include
129129
:param bool stop: If true, output an I2C stop condition after the buffer is written
130130
"""
131+
if out_end is None:
132+
out_end = len(out_buffer)
133+
if in_end is None:
134+
in_end = len(in_buffer)
131135
if hasattr(self.i2c, 'writeto_then_readfrom'):
132136
# In linux, at least, this is a special kernel function call
133137
self.i2c.writeto_then_readfrom(self.device_address, out_buffer, in_buffer,

0 commit comments

Comments
 (0)