if sound is not available under windows, don't crash
This commit is contained in:
parent
9aa5b02fc5
commit
7e7bceea97
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue