]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/generic_linux/i2c.py
Revert back, because i have an older version of libgpiod.
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / generic_linux / i2c.py
index 1870dfc802eb28206a1bca6c8f3ddbd0fa10d124..f6bee20c8f878ab18fbbb08fb620594556dc2cd5 100644 (file)
@@ -1,5 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """Generic Linux I2C class using PureIO's smbus class"""
 """Generic Linux I2C class using PureIO's smbus class"""
-import Adafruit_PureIO.smbus as smbus
+from Adafruit_PureIO import smbus
 
 
 class I2C:
 
 
 class I2C:
@@ -25,7 +28,7 @@ class I2C:
         except FileNotFoundError:
             raise RuntimeError(
                 "I2C Bus #%d not found, check if enabled in config!" % bus_num
         except FileNotFoundError:
             raise RuntimeError(
                 "I2C Bus #%d not found, check if enabled in config!" % bus_num
-            )
+            ) from RuntimeError
 
     # pylint: enable=unused-argument
 
 
     # pylint: enable=unused-argument
 
@@ -69,7 +72,7 @@ class I2C:
         out_end=None,
         in_start=0,
         in_end=None,
         out_end=None,
         in_start=0,
         in_end=None,
-        stop=False
+        stop=False,
     ):
         """Write data from buffer_out to an address and then
         read data from an address and into buffer_in
     ):
         """Write data from buffer_out to an address and then
         read data from an address and into buffer_in