summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sunaudiodev.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-01-13 20:53:46 (GMT)
committerBarry Warsaw <barry@python.org>1997-01-13 20:53:46 (GMT)
commit3de721d073f009a2a44287be148ea44258946dc0 (patch)
tree3245cbad1afa46866b68a27f25976b78dfb878a6 /Lib/test/test_sunaudiodev.py
parent59e066e73b9c64c9fd5cbb5b61c37a742367a344 (diff)
downloadcpython-3de721d073f009a2a44287be148ea44258946dc0.zip
cpython-3de721d073f009a2a44287be148ea44258946dc0.tar.gz
cpython-3de721d073f009a2a44287be148ea44258946dc0.tar.bz2
Catch sunaudiodev.error on open() and re-raise TestFailed exception.
Diffstat (limited to 'Lib/test/test_sunaudiodev.py')
-rw-r--r--Lib/test/test_sunaudiodev.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_sunaudiodev.py b/Lib/test/test_sunaudiodev.py
index 9902cf5..aa85752 100644
--- a/Lib/test/test_sunaudiodev.py
+++ b/Lib/test/test_sunaudiodev.py
@@ -14,9 +14,13 @@ def play_sound_file(path):
fp = open(path, 'r')
data = fp.read()
fp.close()
- a = sunaudiodev.open('w')
- a.write(data)
- a.close()
+ try:
+ a = sunaudiodev.open('w')
+ except sunaudiodev.error, msg:
+ raise TestFailed, msg
+ else:
+ a.write(data)
+ a.close()
def test():
play_sound_file(findfile('audiotest.au'))