summaryrefslogtreecommitdiffstats
path: root/Lib/wave.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-01-13 03:49:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-01-13 03:49:50 (GMT)
commit5efea0430caf2c6e066ae2f32e4c28f65d42d69a (patch)
tree49eec9ffecadf8911742b948c763b1b7ffcf447e /Lib/wave.py
parentee5383da5a3c78acb8f4d1fa0898ba8fcbf67e41 (diff)
downloadcpython-5efea0430caf2c6e066ae2f32e4c28f65d42d69a.zip
cpython-5efea0430caf2c6e066ae2f32e4c28f65d42d69a.tar.gz
cpython-5efea0430caf2c6e066ae2f32e4c28f65d42d69a.tar.bz2
use floor division where needed #7681
Diffstat (limited to 'Lib/wave.py')
-rw-r--r--Lib/wave.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/wave.py b/Lib/wave.py
index 8455522..2fa9b6b 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -240,7 +240,7 @@ class Wave_read:
data = array.array(_array_fmts[self._sampwidth])
nitems = nframes * self._nchannels
if nitems * self._sampwidth > chunk.chunksize - chunk.size_read:
- nitems = (chunk.chunksize - chunk.size_read) / self._sampwidth
+ nitems = (chunk.chunksize - chunk.size_read) // self._sampwidth
data.fromfile(chunk.file.file, nitems)
# "tell" data chunk how much was read
chunk.size_read = chunk.size_read + nitems * self._sampwidth
@@ -461,7 +461,7 @@ class Wave_write:
def _write_header(self, initlength):
self._file.write(b'RIFF')
if not self._nframes:
- self._nframes = initlength / (self._nchannels * self._sampwidth)
+ self._nframes = initlength // (self._nchannels * self._sampwidth)
self._datalength = self._nframes * self._nchannels * self._sampwidth
self._form_length_pos = self._file.tell()
self._file.write(struct.pack('<l4s4slhhllhh4s',