Skip to content

Commit 318f7f7

Browse files
authored
Merge pull request #79 from dhalbert/fix-typing-imports
fix typing-only imports
2 parents b5eab2e + c06a2fa commit 318f7f7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

adafruit_bus_device/i2c_device.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
from typing import Optional, Type
1212
from types import TracebackType
1313
from circuitpython_typing import ReadableBuffer, WriteableBuffer
14+
15+
# Used only for type annotations.
16+
from busio import I2C
1417
except ImportError:
1518
pass
1619

17-
from busio import I2C
1820

1921
__version__ = "0.0.0-auto.0"
2022
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BusDevice.git"

adafruit_bus_device/spi_device.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
try:
1313
from typing import Optional, Type
1414
from types import TracebackType
15+
16+
# Used only for type annotations.
17+
from busio import SPI
18+
from digitalio import DigitalInOut
1519
except ImportError:
1620
pass
1721

18-
from busio import SPI
19-
from digitalio import DigitalInOut
2022

2123
__version__ = "0.0.0-auto.0"
2224
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BusDevice.git"

0 commit comments

Comments
 (0)