]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/generic_linux/i2c.py
black
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / generic_linux / i2c.py
index b151798d90d68e77f25a07b708316e1afb2cdd58..bb912a5b80210b72dc626663ff124dc24832d74b 100644 (file)
@@ -11,6 +11,7 @@ class I2C:
     _mode = None
     _i2c_bus = None
 
     _mode = None
     _i2c_bus = None
 
+    # pylint: disable=unused-argument
     def __init__(self, bus_num, mode=MASTER, baudrate=None):
         if mode != self.MASTER:
             raise NotImplementedError("Only I2C Master supported!")
     def __init__(self, bus_num, mode=MASTER, baudrate=None):
         if mode != self.MASTER:
             raise NotImplementedError("Only I2C Master supported!")
@@ -24,7 +25,9 @@ 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
 
     def scan(self):
         """Try to read a byte from each address, if you get an OSError
 
     def scan(self):
         """Try to read a byte from each address, if you get an OSError
@@ -66,7 +69,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