mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
ccd615c1a7
commit
8bcbe6aa7e
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue