summaryrefslogtreecommitdiffstats
path: root/Lib/wave.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/wave.py')
-rw-r--r--Lib/wave.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/wave.py b/Lib/wave.py
index 6285c74..4a22345 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -424,7 +424,9 @@ class Wave_write:
data = self._convert(data)
if self._sampwidth in (2, 4) and sys.byteorder == 'big':
import array
- data = array.array(_array_fmts[self._sampwidth], data)
+ a = array.array(_array_fmts[self._sampwidth])
+ a.frombytes(data)
+ data = a
assert data.itemsize == self._sampwidth
data.byteswap()
data.tofile(self._file)