From: Melissa LeBlanc-Williams Date: Tue, 29 Oct 2019 17:04:24 +0000 (-0700) Subject: Changed error to more appropriate type X-Git-Tag: 3.0.0^2 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/65a43f89301ab954690821cd97e4174c78762c88?ds=inline;hp=--cc Changed error to more appropriate type --- 65a43f89301ab954690821cd97e4174c78762c88 diff --git a/src/busio.py b/src/busio.py index 9702848..ddf290d 100755 --- a/src/busio.py +++ b/src/busio.py @@ -31,7 +31,7 @@ class I2C(Lockable): self._i2c = _I2C(portId, mode=_I2C.MASTER, baudrate=frequency) break else: - raise NotImplementedError( + raise ValueError( "No Hardware I2C on (scl,sda)={}\nValid I2C ports: {}".format((scl, sda), i2cPorts) ) @@ -95,7 +95,7 @@ class SPI(Lockable): self._pins = (portSck, portMosi, portMiso) break else: - raise NotImplementedError( + raise ValueError( "No Hardware SPI on (SCLK, MOSI, MISO)={}\nValid SPI ports:{}". format((clock, MOSI, MISO), spiPorts)) @@ -230,7 +230,7 @@ class UART(Lockable): ) break else: - raise NotImplementedError( + raise ValueError( "No Hardware UART on (tx,rx)={}\nValid UART ports: {}".format((tx, rx), uartPorts) )