summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2011-12-10 16:54:47 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2011-12-10 20:01:44 +0100
commite9de9c90da6bd8c6a2314fb68f37cefc0a480926 (patch)
treec1566ec8f99fd8447e3c9b040f78ac5332c6d758 /decoders
parent5b6b4f7759cf726bbfc00bd30b2e02cdea33cc6d (diff)
downloadlibsigrokdecode-e9de9c90da6bd8c6a2314fb68f37cefc0a480926.tar.gz
libsigrokdecode-e9de9c90da6bd8c6a2314fb68f37cefc0a480926.zip
srd: decoders: Don't use problematic and/or construct.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/i2c.py4
1 files changed, 2 insertions, 2 deletions
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: