mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Merged revisions 77459 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r77459 | benjamin.peterson | 2010-01-12 21:49:50 -0600 (Tue, 12 Jan 2010) | 1 line use floor division where needed #7681 ........
This commit is contained in:
parent
fae34df767
commit
109d3ab2c8
3 changed files with 15 additions and 2 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue