Skip to content

Commit d51a9ec

Browse files
committed
Swap smbus for smbus2.
1 parent d33c0ce commit d51a9ec

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

cap1xxx/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@
1010
import atexit
1111
import threading
1212
import time
13-
from sys import version_info
1413

15-
try:
16-
from smbus import SMBus
17-
except ImportError:
18-
if version_info[0] < 3:
19-
raise ImportError("This library requires python-smbus\nInstall with: sudo apt-get install python-smbus")
20-
elif version_info[0] == 3:
21-
raise ImportError("This library requires python3-smbus\nInstall with: sudo apt-get install python3-smbus")
14+
from smbus2 import SMBus
2215

2316
try:
2417
import RPi.GPIO as GPIO

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ classifiers = [
3535
"Topic :: System :: Hardware",
3636
]
3737
dependencies = [
38+
"smbus2"
3839
]
3940

4041
[project.urls]

0 commit comments

Comments
 (0)