summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-05-29 20:45:05 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-05-29 20:45:05 (GMT)
commitad0e6b1034b2d727d666470f691364ebf8defd1b (patch)
tree94fa078dd160c0cc60de729b2917b2b6b9e73c19
parentb6cc0aad4bb288494a8f8c9f2f501afc9573b910 (diff)
parentd739bda6b254314fdded5da993dafb82125fa25f (diff)
downloadcpython-ad0e6b1034b2d727d666470f691364ebf8defd1b.zip
cpython-ad0e6b1034b2d727d666470f691364ebf8defd1b.tar.gz
cpython-ad0e6b1034b2d727d666470f691364ebf8defd1b.tar.bz2
Merge heads
-rw-r--r--Lib/wave.py11
-rw-r--r--Misc/ACKS1
2 files changed, 4 insertions, 8 deletions
diff --git a/Lib/wave.py b/Lib/wave.py
index e3bf2af..ea410c1 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -82,13 +82,8 @@ WAVE_FORMAT_PCM = 0x0001
_array_fmts = None, 'b', 'h', None, 'l'
-# Determine endian-ness
import struct
-if struct.pack("h", 1) == b"\000\001":
- big_endian = 1
-else:
- big_endian = 0
-
+import sys
from chunk import Chunk
from collections import namedtuple
@@ -235,7 +230,7 @@ class Wave_read:
self._data_seek_needed = 0
if nframes == 0:
return b''
- if self._sampwidth > 1 and big_endian:
+ if self._sampwidth > 1 and sys.byteorder == 'big':
# unfortunately the fromfile() method does not take
# something that only looks like a file object, so
# we have to reach into the innards of the chunk object
@@ -422,7 +417,7 @@ class Wave_write:
nframes = len(data) // (self._sampwidth * self._nchannels)
if self._convert:
data = self._convert(data)
- if self._sampwidth > 1 and big_endian:
+ if self._sampwidth > 1 and sys.byteorder == 'big':
import array
data = array.array(_array_fmts[self._sampwidth], data)
data.byteswap()
diff --git a/Misc/ACKS b/Misc/ACKS
index 9ba99cd..3ce5cd2 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1222,6 +1222,7 @@ Thenault Sylvain
Péter Szabó
Amir Szekely
Arfrever Frehtes Taifersar Arahesis
+Hideaki Takahashi
Neil Tallim
Geoff Talvola
Musashi Tamura