commit | 452bab4acf57c8dd156b794fe0d1672e1ab29b43 | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Sat Nov 16 14:01:31 2013 +0200 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Sat Nov 16 14:01:31 2013 +0200 |
tree | d167584d1dd05c4ca5303c4ff91c2dfa927a5e06 | |
parent | 7714ebbe0e7556bbfa6b768e434042b55474939c [diff] [blame] |
Issue #16685: Added support for writing any bytes-like objects in the aifc, sunau, and wave modules.
diff --git a/Lib/sunau.py b/Lib/sunau.py index 1880a01..3c24492 100644 --- a/Lib/sunau.py +++ b/Lib/sunau.py
@@ -415,6 +415,8 @@ return self._nframeswritten def writeframesraw(self, data): + if not isinstance(data, (bytes, bytearray)): + data = memoryview(data).cast('B') self._ensure_header_written() if self._comptype == 'ULAW': import audioop