Merged revisions 75407,75409-75413,75415,75419-75421 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75407 | antoine.pitrou | 2009-10-14 20:30:52 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in the aifc module
........
r75409 | antoine.pitrou | 2009-10-14 21:01:33 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in bsddb
........
r75410 | antoine.pitrou | 2009-10-14 21:09:45 +0300 (Wed, 14 Oct 2009) | 3 lines
Silence a py3k warning claiming to affect Lib/calendar.py
........
r75411 | antoine.pitrou | 2009-10-14 21:12:54 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn)
........
r75412 | antoine.pitrou | 2009-10-14 21:27:32 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in the socket module
........
r75413 | antoine.pitrou | 2009-10-14 21:31:05 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix a py3k warning in the sndhdr module (found with test_email)
........
r75415 | antoine.pitrou | 2009-10-14 21:39:46 +0300 (Wed, 14 Oct 2009) | 3 lines
Silence some py3k warnings claiming to affect _pyio
........
r75419 | antoine.pitrou | 2009-10-14 21:56:11 +0300 (Wed, 14 Oct 2009) | 3 lines
Silence py3k warning claiming to affect the random module
........
r75420 | antoine.pitrou | 2009-10-14 22:04:48 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in httplib
........
r75421 | antoine.pitrou | 2009-10-14 22:09:48 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in the uuid module
........
diff --git a/Lib/aifc.py b/Lib/aifc.py
index e0b76d6..76bc74c 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -409,7 +409,7 @@
data = self._ssnd_chunk.read(nframes * self._framesize)
if self._convert and data:
data = self._convert(data)
- self._soundpos = self._soundpos + len(data) / (self._nchannels * self._sampwidth)
+ self._soundpos = self._soundpos + len(data) // (self._nchannels * self._sampwidth)
return data
#
@@ -420,7 +420,7 @@
import cl
dummy = self._decomp.SetParam(cl.FRAME_BUFFER_SIZE,
len(data) * 2)
- return self._decomp.Decompress(len(data) / self._nchannels,
+ return self._decomp.Decompress(len(data) // self._nchannels,
data)
def _ulaw2lin(self, data):
@@ -439,7 +439,7 @@
def _read_comm_chunk(self, chunk):
self._nchannels = _read_short(chunk)
self._nframes = _read_long(chunk)
- self._sampwidth = (_read_short(chunk) + 7) / 8
+ self._sampwidth = (_read_short(chunk) + 7) // 8
self._framerate = int(_read_float(chunk))
self._framesize = self._nchannels * self._sampwidth
if self._aifc:
@@ -468,7 +468,7 @@
pass
else:
self._convert = self._adpcm2lin
- self._framesize = self._framesize / 4
+ self._framesize = self._framesize // 4
return
# for ULAW and ALAW try Compression Library
try:
@@ -478,17 +478,17 @@
try:
import audioop
self._convert = self._ulaw2lin
- self._framesize = self._framesize / 2
+ self._framesize = self._framesize // 2
return
except ImportError:
pass
raise Error, 'cannot read compressed AIFF-C files'
if self._comptype == 'ULAW':
scheme = cl.G711_ULAW
- self._framesize = self._framesize / 2
+ self._framesize = self._framesize // 2
elif self._comptype == 'ALAW':
scheme = cl.G711_ALAW
- self._framesize = self._framesize / 2
+ self._framesize = self._framesize // 2
else:
raise Error, 'unsupported compression type'
self._decomp = cl.OpenDecompressor(scheme)
@@ -706,7 +706,7 @@
def writeframesraw(self, data):
self._ensure_header_written(len(data))
- nframes = len(data) / (self._sampwidth * self._nchannels)
+ nframes = len(data) // (self._sampwidth * self._nchannels)
if self._convert:
data = self._convert(data)
self._file.write(data)
@@ -820,17 +820,17 @@
self._init_compression()
self._file.write('FORM')
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
if self._datalength & 1:
self._datalength = self._datalength + 1
if self._aifc:
if self._comptype in ('ULAW', 'ALAW'):
- self._datalength = self._datalength / 2
+ self._datalength = self._datalength // 2
if self._datalength & 1:
self._datalength = self._datalength + 1
elif self._comptype == 'G722':
- self._datalength = (self._datalength + 3) / 4
+ self._datalength = (self._datalength + 3) // 4
if self._datalength & 1:
self._datalength = self._datalength + 1
self._form_length_pos = self._file.tell()