diff options
author | Trent Nelson <trent.nelson@snakebite.org> | 2008-03-18 07:32:47 (GMT) |
---|---|---|
committer | Trent Nelson <trent.nelson@snakebite.org> | 2008-03-18 07:32:47 (GMT) |
commit | 496ad271867d79925f94492939ba64285d7f796c (patch) | |
tree | cc10c1b339d1e84d1749bb06b5762afeed8338f8 /Lib | |
parent | 3ce76756d31916f80d6a03b0dc257ec7036dcb5c (diff) | |
download | cpython-496ad271867d79925f94492939ba64285d7f796c.zip cpython-496ad271867d79925f94492939ba64285d7f796c.tar.gz cpython-496ad271867d79925f94492939ba64285d7f796c.tar.bz2 |
The behaviour of winsound.Beep() seems to differ between different versions of Windows when there's either:
a) no sound card entirely
b) legacy beep driver has been disabled
c) the legacy beep driver has been uninstalled
Sometimes RuntimeErrors are raised, sometimes they're not. If _have_soundcard() returns False, don't expect winsound.Beep() to raise a RuntimeError, as this clearly isn't the case, as demonstrated by the various Win32 XP buildbots.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_winsound.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index 5606c44..1c524c9 100644 --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -26,8 +26,16 @@ class BeepTest(unittest.TestCase): winsound.Beep(37, 75) winsound.Beep(32767, 75) else: - self.assertRaises(RuntimeError, winsound.Beep, 37, 75) - self.assertRaises(RuntimeError, winsound.Beep, 32767, 75) + # The behaviour of winsound.Beep() seems to differ between + # different versions of Windows when there's either a) no + # sound card entirely, b) legacy beep driver has been disabled, + # or c) the legacy beep driver has been uninstalled. Sometimes + # RuntimeErrors are raised, sometimes they're not. Meh. + try: + winsound.Beep(37, 75) + winsound.Beep(32767, 75) + except RuntimeError: + pass def test_increasingfrequency(self): if _have_soundcard(): |