From: Uwe Hermann Date: Sat, 10 Dec 2011 15:54:47 +0000 (+0100) Subject: srd: decoders: Don't use problematic and/or construct. X-Git-Tag: libsigrokdecode-0.1.0~241 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e9de9c90da6bd8c6a2314fb68f37cefc0a480926;p=libsigrokdecode.git srd: decoders: Don't use problematic and/or construct. --- diff --git a/decoders/i2c.py b/decoders/i2c.py index 2b3b875..659ea55 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -240,12 +240,12 @@ class Decoder(sigrok.Decoder): # We received 8 address/data bits and the ACK/NACK bit. self.databyte >>= 1 # Shift out unwanted ACK/NACK bit here. - ack = (sda == 1) and 'N' or 'A' + ack = 'N' if (sda == 1) else 'A' if self.state == FIND_ADDRESS: d = self.databyte & 0xfe # The READ/WRITE bit is only in address bytes, not data bytes. - self.wr = (self.databyte & 1) and 1 or 0 + self.wr = 1 if (self.databyte & 1) else 0 elif self.state == FIND_DATA: d = self.databyte else: