From: Barry Warsaw Date: Mon, 13 Jan 1997 20:53:46 +0000 (+0000) Subject: Catch sunaudiodev.error on open() and re-raise TestFailed exception. X-Git-Tag: v1.5a1~533 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3de721d073f009a2a44287be148ea44258946dc0;p=thirdparty%2FPython%2Fcpython.git Catch sunaudiodev.error on open() and re-raise TestFailed exception. --- diff --git a/Lib/test/test_sunaudiodev.py b/Lib/test/test_sunaudiodev.py index 9902cf5407f2..aa85752e20be 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'))