]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/board.py
Check if pins are in locals instead of try/except
[Adafruit_Blinka-hackapet.git] / src / board.py
index 9de41722cd9b9eb015c5a120383dc068fa4d89be..9cdd379bd1e886e97a13593e81757654c74994cd 100755 (executable)
@@ -224,7 +224,7 @@ elif "sphinx" in sys.modules:
 else:
     raise NotImplementedError("Board not supported {}".format(board_id))
 
-if SCL and SDA:
+if "SCL" in locals() and "SDA" in locals():
 
     def I2C():
         """The singleton I2C interface"""
@@ -233,7 +233,7 @@ if SCL and SDA:
         return busio.I2C(SCL, SDA)
 
 
-if SCLK and MOSI and MISO:
+if "SCLK" in locals() and "MOSI" in locals() and "MISO" in locals():
 
     def SPI():
         """The singleton SPI interface"""