summaryrefslogtreecommitdiff
path: root/display/puremixer.py
diff options
context:
space:
mode:
authorDiego Roversi <diegor@tiscali.it>2019-09-12 21:33:58 +0200
committerDiego Roversi <diegor@tiscali.it>2019-09-12 21:33:58 +0200
commitf2779197b13fdbbd0d42e48215c51d24d86ee91b (patch)
tree968267aa9909470c27b43109029e87d1f126b4e7 /display/puremixer.py
parentbc2155a93cd15c975881d7ca8f57f0f4b5c4aa27 (diff)
2to3 of display module
Diffstat (limited to 'display/puremixer.py')
-rw-r--r--display/puremixer.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/display/puremixer.py b/display/puremixer.py
index d0b567a..52d56d4 100644
--- a/display/puremixer.py
+++ b/display/puremixer.py
@@ -64,7 +64,7 @@ class PureMixer:
byteorder = self.byteorder
# done
if (freq, bytes, signed, channels, byteorder) != self.parameters:
- raise ValueError, 'sound sample conversion failed'
+ raise ValueError('sound sample conversion failed')
return data
def wavesample(self, file):
@@ -87,7 +87,7 @@ class PureMixer:
channels = mixer_channels[:]
channels.reverse()
for c in channels:
- if already_seen.has_key(c):
+ if c in already_seen:
data1 = ''
else:
data1 = c.read(bufsize)
@@ -114,10 +114,10 @@ def byteswap(data, byte):
elif byte == 4:
typecode = 'i'
else:
- raise ValueError, 'cannot convert endianness for samples of %d bytes' % byte
+ raise ValueError('cannot convert endianness for samples of %d bytes' % byte)
import array
a = array.array(typecode, data)
if a.itemsize != byte:
- raise ValueError, 'endianness convertion failed'
+ raise ValueError('endianness convertion failed')
a.byteswap()
return a.tostring()