summaryrefslogtreecommitdiff
path: root/decoders/midi/pd.py
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2016-09-24 13:20:39 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2016-09-24 13:20:39 +0200
commit73c8d0fbdffe673d334f02bafb94f681a5c29ea9 (patch)
tree5a530528821963a69a4faa390a85f25fe5e62f0a /decoders/midi/pd.py
parent8657abb6e0aecf0e7e76f6f757292ec5bd6e8205 (diff)
downloadlibsigrokdecode-73c8d0fbdffe673d334f02bafb94f681a5c29ea9.tar.gz
libsigrokdecode-73c8d0fbdffe673d334f02bafb94f681a5c29ea9.zip
midi: Use "is" or "is not" with None.
Diffstat (limited to 'decoders/midi/pd.py')
-rw-r--r--decoders/midi/pd.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/decoders/midi/pd.py b/decoders/midi/pd.py
index 70c7120..a631473 100644
--- a/decoders/midi/pd.py
+++ b/decoders/midi/pd.py
@@ -317,7 +317,7 @@ class Decoder(srd.Decoder):
self.soft_clear_status_byte()
def handle_channel_msg(self, newbyte):
- if newbyte != None:
+ if newbyte is not None:
if newbyte >= 0x80:
self.set_status_byte(newbyte)
else:
@@ -325,7 +325,7 @@ class Decoder(srd.Decoder):
msg_type = self.status_byte & 0xf0
handle_msg = getattr(self, 'handle_channel_msg_0x%02x' % msg_type,
self.handle_channel_msg_generic)
- handle_msg(newbyte == None)
+ handle_msg(newbyte is None)
def handle_sysex_msg(self, newbyte):
# SysEx message: 1 status byte, 1-3 manuf. bytes, x data bytes, EOX byte
@@ -334,7 +334,7 @@ class Decoder(srd.Decoder):
# by any non-SysReal status byte, and it clears self.status_byte.
# Note: all System message code doesn't utilize self.status_byte
self.hard_clear_status_byte()
- if newbyte != 0xf7 and newbyte != None: # EOX
+ if newbyte != 0xf7 and newbyte is not None: # EOX
self.cmd.append(newbyte)
return
self.es_block = self.es
@@ -403,7 +403,7 @@ class Decoder(srd.Decoder):
# and System Exclusive and System Common clear it.
c = self.cmd
if len(c) < 2:
- if newbyte == None:
+ if newbyte is None:
self.handle_garbage_msg(None)
return
msg = c[0]
@@ -444,7 +444,7 @@ class Decoder(srd.Decoder):
# is actually only used with SysEx messages so it is processed there.
# Note 2: all System message code doesn't utilize self.status_byte
self.hard_clear_status_byte()
- if newbyte != None:
+ if newbyte is not None:
self.cmd.append(newbyte)
c = self.cmd
msg = c[0]
@@ -457,7 +457,7 @@ class Decoder(srd.Decoder):
# Song position pointer: F2 ll mm
# ll = LSB position, mm = MSB position
if len(c) < 3:
- if newbyte == None:
+ if newbyte is None:
self.handle_garbage_msg(None)
return
ll, mm = c[1], c[2]
@@ -473,7 +473,7 @@ class Decoder(srd.Decoder):
# Song select: F3 ss
# ss = song selection number
if len(c) < 2:
- if newbyte == None:
+ if newbyte is None:
self.handle_garbage_msg(None)
return
ss = c[1]
@@ -516,7 +516,7 @@ class Decoder(srd.Decoder):
def handle_garbage_msg(self, newbyte):
# Handles messages that are either not handled or are corrupt
self.es_block = self.es
- if newbyte != None:
+ if newbyte is not None:
self.cmd.append(newbyte)
return
payload = '<empty>'