summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ossaudiodev.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-01-08 07:09:43 (GMT)
committerFred Drake <fdrake@acm.org>2003-01-08 07:09:43 (GMT)
commit7511bd957d40b44442eb1dddc95e8c3b0b787eab (patch)
tree7c692ef9fdeb9f35e230f0e55b5979e5d40e0c61 /Lib/test/test_ossaudiodev.py
parent55d555f012edd3d9a0d020ec7eb6084fbd3d34ca (diff)
downloadcpython-7511bd957d40b44442eb1dddc95e8c3b0b787eab.zip
cpython-7511bd957d40b44442eb1dddc95e8c3b0b787eab.tar.gz
cpython-7511bd957d40b44442eb1dddc95e8c3b0b787eab.tar.bz2
- be explicit: audio data files should be opened in binary mode
- ossaudiodev.open() raises IOError, not ossaudiodev.error, for cases which get mapped to TestSkipped
Diffstat (limited to 'Lib/test/test_ossaudiodev.py')
-rw-r--r--Lib/test/test_ossaudiodev.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py
index 371d1a7..ed8f770 100644
--- a/Lib/test/test_ossaudiodev.py
+++ b/Lib/test/test_ossaudiodev.py
@@ -13,7 +13,7 @@ import audioop
SND_FORMAT_MULAW_8 = 1
def read_sound_file(path):
- fp = open(path, 'r')
+ fp = open(path, 'rb')
size, enc, rate, nchannels, extra = sunaudio.gethdr(fp)
data = fp.read()
fp.close()
@@ -30,7 +30,7 @@ def read_sound_file(path):
def play_sound_file(data, rate, ssize, nchannels):
try:
a = ossaudiodev.open('w')
- except ossaudiodev.error, msg:
+ except IOError, msg:
if msg[0] in (errno.EACCES, errno.ENODEV, errno.EBUSY):
raise TestSkipped, msg
raise TestFailed, msg