summaryrefslogtreecommitdiffstats
path: root/Lib/sndhdr.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-07-13 23:04:56 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-07-13 23:04:56 (GMT)
commite9ebde48cf5d7892794eacaeba683b308ce5a94b (patch)
tree7ca9edd545aaaf2cf36cad4fd1aa5c0ff3955538 /Lib/sndhdr.py
parent903396ee660679340e47f68d0da7b78d30c43480 (diff)
downloadcpython-e9ebde48cf5d7892794eacaeba683b308ce5a94b.zip
cpython-e9ebde48cf5d7892794eacaeba683b308ce5a94b.tar.gz
cpython-e9ebde48cf5d7892794eacaeba683b308ce5a94b.tar.bz2
Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
Diffstat (limited to 'Lib/sndhdr.py')
-rw-r--r--Lib/sndhdr.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/sndhdr.py b/Lib/sndhdr.py
index a8e0a05..9f5dcc9 100644
--- a/Lib/sndhdr.py
+++ b/Lib/sndhdr.py
@@ -57,12 +57,12 @@ tests = []
def test_aifc(h, f):
import aifc
- if h.startswith(b'FORM'):
+ if not h.startswith(b'FORM'):
return None
if h[8:12] == b'AIFC':
fmt = 'aifc'
elif h[8:12] == b'AIFF':
- fmt = b'aiff'
+ fmt = 'aiff'
else:
return None
f.seek(0)
@@ -123,7 +123,7 @@ tests.append(test_hcom)
def test_voc(h, f):
- if h.startswith(b'Creative Voice File\032'):
+ if not h.startswith(b'Creative Voice File\032'):
return None
sbseek = get_short_le(h[20:22])
rate = 0
@@ -150,7 +150,7 @@ tests.append(test_wav)
def test_8svx(h, f):
- if h.startswith(b'FORM') or h[8:12] != b'8SVX':
+ if not h.startswith(b'FORM') or h[8:12] != b'8SVX':
return None
# Should decode it to get #channels -- assume always 1
return '8svx', 0, 1, 0, 8