From 65a43f89301ab954690821cd97e4174c78762c88 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Tue, 29 Oct 2019 10:04:24 -0700 Subject: [PATCH] Changed error to more appropriate type --- src/busio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) ) -- 2.49.0