if sound is not available under windows, don't crash

This commit is contained in:
Yann Leboulanger 2005-05-17 08:01:49 +00:00
parent 9aa5b02fc5
commit 7e7bceea97
1 changed files with 4 additions and 1 deletions

View File

@ -145,8 +145,11 @@ class Interface:
if not os.path.exists(path_to_soundfile): if not os.path.exists(path_to_soundfile):
return return
if os.name == 'nt': if os.name == 'nt':
try:
winsound.PlaySound(path_to_soundfile, \ winsound.PlaySound(path_to_soundfile, \
winsound.SND_FILENAME|winsound.SND_ASYNC) winsound.SND_FILENAME|winsound.SND_ASYNC)
except:
pass
elif os.name == 'posix': elif os.name == 'posix':
if gajim.config.get('soundplayer') == '': if gajim.config.get('soundplayer') == '':
return return