Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 323a508

Browse files
author
Moshe Zadka
committed
In case the user isn't allowed to access /dev/dsp or /dev/dsp isn't there
at all (my computer doesn't have a Sound Blaster), this doesn't mean there's a bug in linuxaudiodev. The only error the test suite skips is currently ImportError -- so that's what we raise. If you see a problem with this patch, say so and I'll retract. If you think raising an ImportError sucks, you're right -- but I ain't gonna buy a SB and I sure ain't gonna let the test-suite fail on my machine.
1 parent b9fb1f2 commit 323a508

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_linuxaudiodev.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from test_support import verbose, findfile, TestFailed
22
import linuxaudiodev
3+
import errno
34
import os
45

56
def play_sound_file(path):
@@ -9,6 +10,8 @@ def play_sound_file(path):
910
try:
1011
a = linuxaudiodev.open('w')
1112
except linuxaudiodev.error, msg:
13+
if msg[0] in (errno.EACCES, errno.ENODEV):
14+
raise ImportError, msg
1215
raise TestFailed, msg
1316
else:
1417
a.write(data)

0 commit comments

Comments
 (0)