summaryrefslogtreecommitdiffstats
path: root/Lib/aifc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-16 12:01:31 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-16 12:01:31 (GMT)
commit452bab4acf57c8dd156b794fe0d1672e1ab29b43 (patch)
treed167584d1dd05c4ca5303c4ff91c2dfa927a5e06 /Lib/aifc.py
parent7714ebbe0e7556bbfa6b768e434042b55474939c (diff)
downloadcpython-452bab4acf57c8dd156b794fe0d1672e1ab29b43.zip
cpython-452bab4acf57c8dd156b794fe0d1672e1ab29b43.tar.gz
cpython-452bab4acf57c8dd156b794fe0d1672e1ab29b43.tar.bz2
Issue #16685: Added support for writing any bytes-like objects in the aifc,
sunau, and wave modules.
Diffstat (limited to 'Lib/aifc.py')
-rw-r--r--Lib/aifc.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/aifc.py b/Lib/aifc.py
index 18f236d..c1c8ea7 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -692,6 +692,8 @@ class Aifc_write:
return self._nframeswritten
def writeframesraw(self, data):
+ if not isinstance(data, (bytes, bytearray)):
+ data = memoryview(data).cast('B')
self._ensure_header_written(len(data))
nframes = len(data) // (self._sampwidth * self._nchannels)
if self._convert: