Commit 3de721d0 authored by Barry Warsaw's avatar Barry Warsaw

Catch sunaudiodev.error on open() and re-raise TestFailed exception.

parent 59e066e7
...@@ -14,9 +14,13 @@ def play_sound_file(path): ...@@ -14,9 +14,13 @@ def play_sound_file(path):
fp = open(path, 'r') fp = open(path, 'r')
data = fp.read() data = fp.read()
fp.close() fp.close()
a = sunaudiodev.open('w') try:
a.write(data) a = sunaudiodev.open('w')
a.close() except sunaudiodev.error, msg:
raise TestFailed, msg
else:
a.write(data)
a.close()
def test(): def test():
play_sound_file(findfile('audiotest.au')) play_sound_file(findfile('audiotest.au'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment