Skip to content

Commit 02c90b1

Browse files
jerryneedelltannewt
authored andcommitted
fix call to RuntimeError (#2)
1 parent d03c54c commit 02c90b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Adafruit_CCS811.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def __init__(self, i2c, addr=0x5A):
108108

109109
#check that the HW id is correct
110110
if self.hw_id != CCS811_HW_ID_CODE:
111-
raise RuntimeException("Device ID returned is not correct! Please check your wiring.")
111+
raise RuntimeError("Device ID returned is not correct! Please check your wiring.")
112112

113113
#try to start the app
114114
buf = bytearray(1)
@@ -118,9 +118,9 @@ def __init__(self, i2c, addr=0x5A):
118118

119119
#make sure there are no errors and we have entered application mode
120120
if self.checkError():
121-
raise RuntimeException("Device returned an Error! Try removing and reapplying power to the device and running the code again.")
121+
raise RuntimeError("Device returned an Error! Try removing and reapplying power to the device and running the code again.")
122122
if not self.fw_mode:
123-
raise RuntimeException("Device did not enter application mode! If you got here, there may be a problem with the firmware on your sensor.")
123+
raise RuntimeError("Device did not enter application mode! If you got here, there may be a problem with the firmware on your sensor.")
124124

125125
self.interrupt_enabled = False
126126

@@ -222,4 +222,4 @@ def SWReset(self):
222222

223223

224224
def checkError(self):
225-
return self.error
225+
return self.error

0 commit comments

Comments
 (0)