]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Catch sunaudiodev.error on open() and re-raise TestFailed exception.
authorBarry Warsaw <barry@python.org>
Mon, 13 Jan 1997 20:53:46 +0000 (20:53 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 13 Jan 1997 20:53:46 +0000 (20:53 +0000)
Lib/test/test_sunaudiodev.py

index 9902cf5407f2aa4ac3a8144d136a7e574c085f59..aa85752e20bec6e1c5d5b8d2a057b3656dcaa531 100644 (file)
@@ -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'))