Issue #17487: The result of the wave getparams method now is pickleable again.

Patch by Claudiu Popa.
This commit is contained in:
Serhiy Storchaka 2013-09-04 00:28:43 +03:00
parent c6171e49ab
commit 4c6a020a2d
3 changed files with 19 additions and 3 deletions

View file

@ -87,7 +87,7 @@ import sys
from chunk import Chunk
from collections import namedtuple
_result = namedtuple('params',
_wave_params = namedtuple('_wave_params',
'nchannels sampwidth framerate nframes comptype compname')
class Wave_read:
@ -212,7 +212,7 @@ class Wave_read:
return self._compname
def getparams(self):
return _result(self.getnchannels(), self.getsampwidth(),
return _wave_params(self.getnchannels(), self.getsampwidth(),
self.getframerate(), self.getnframes(),
self.getcomptype(), self.getcompname())
@ -410,7 +410,7 @@ class Wave_write:
def getparams(self):
if not self._nchannels or not self._sampwidth or not self._framerate:
raise Error('not all parameters set')
return _result(self._nchannels, self._sampwidth, self._framerate,
return _wave_params(self._nchannels, self._sampwidth, self._framerate,
self._nframes, self._comptype, self._compname)
def setmark(self, id, pos, name):