]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In case the user isn't allowed to access /dev/dsp or /dev/dsp isn't there
authorMoshe Zadka <moshez@math.huji.ac.il>
Fri, 4 Aug 2000 12:59:40 +0000 (12:59 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Fri, 4 Aug 2000 12:59:40 +0000 (12:59 +0000)
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.

Lib/test/test_linuxaudiodev.py

index 4b612a79935c870cc29907be54d3ee2e54508fdb..ad7fdf238dd9806d76fea3dd876eb9dc7a8b65d6 100644 (file)
@@ -1,5 +1,6 @@
 from test_support import verbose, findfile, TestFailed
 import linuxaudiodev
+import errno
 import os
 
 def play_sound_file(path):
@@ -9,6 +10,8 @@ def play_sound_file(path):
     try:
         a = linuxaudiodev.open('w')
     except linuxaudiodev.error, msg:
+       if msg[0] in (errno.EACCES, errno.ENODEV):
+               raise ImportError, msg
         raise TestFailed, msg
     else:
         a.write(data)