Fix bugs in "Invalid state" printing/exceptions.
[libsigrokdecode.git] / decoders / i2c / pd.py
index 53321eb02c401525e78fc3bd59774117a1078589..40baf44e572e47f7fe8b1c5db66fdcec93da5d99 100644 (file)
@@ -232,7 +232,7 @@ class Decoder(srd.Decoder):
                 if self.is_data_bit(scl, sda):
                     self.get_ack(scl, sda)
             else:
-                raise Exception('Invalid state %d' % self.STATE)
+                raise Exception('Invalid state: %s' % self.state)
 
             # Save current SDA/SCL values for the next round.
             self.oldscl = scl