mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Catch sunaudiodev.error on open() and re-raise TestFailed exception.
This commit is contained in:
parent
59e066e73b
commit
3de721d073
1 changed files with 7 additions and 3 deletions
|
@ -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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue