diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-06-30 11:57:52 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-06-30 11:57:52 (GMT) |
commit | 8bcbe6aa7e1cc3447a5f572d29d0150b7e1145aa (patch) | |
tree | 3cfef860a88f7309e6a50dca2073033620e3951a /Lib/test | |
parent | ccd615c1a7b9545c4e3a8ab7451633ae909aeb50 (diff) | |
download | cpython-8bcbe6aa7e1cc3447a5f572d29d0150b7e1145aa.zip cpython-8bcbe6aa7e1cc3447a5f572d29d0150b7e1145aa.tar.gz cpython-8bcbe6aa7e1cc3447a5f572d29d0150b7e1145aa.tar.bz2 |
Don't require that a RuntimeError is raised when playing a second
sound while the first one is still running, as the first one
one might already have finished.
Fixes part of SF bug #763052.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_winsound.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index def8c87..7e14599 100644 --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -88,11 +88,15 @@ class PlaySoundTest(unittest.TestCase): winsound.SND_ALIAS | winsound.SND_ASYNC | winsound.SND_LOOP ) time.sleep(0.5) - self.assertRaises( - RuntimeError, - winsound.PlaySound, - 'SystemQuestion', winsound.SND_ALIAS | winsound.SND_NOSTOP - ) + try: + winsound.PlaySound( + 'SystemQuestion', + winsound.SND_ALIAS | winsound.SND_NOSTOP + ) + except RuntimeError: + pass + else: # the first sound might already be finished + pass winsound.PlaySound(None, winsound.SND_PURGE) def test_main(): |