From 3de721d073f009a2a44287be148ea44258946dc0 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 13 Jan 1997 20:53:46 +0000 Subject: [PATCH] Catch sunaudiodev.error on open() and re-raise TestFailed exception. --- Lib/test/test_sunaudiodev.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_sunaudiodev.py b/Lib/test/test_sunaudiodev.py index 9902cf5407f..aa85752e20b 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'))