From 09f54f97d02c5ee13793a7767239d37e98e1a7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 12 Feb 2017 19:04:49 +0100 Subject: [PATCH] Use platform identifier with better granularity Fixes #8542 --- src/common/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/helpers.py b/src/common/helpers.py index 25dffea55..7236a01f0 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -746,13 +746,13 @@ def play_sound_file(path_to_soundfile): path_to_soundfile = check_soundfile_path(path_to_soundfile) if path_to_soundfile is None: return - elif os.name == 'nt' and HAS_WINSOUND: + elif sys.platform == 'win32' and HAS_WINSOUND: try: winsound.PlaySound(path_to_soundfile, winsound.SND_FILENAME|winsound.SND_ASYNC) except Exception: log.exception('Sound Playback Error') - elif os.name == 'posix': + elif sys.platform == 'linux': if gajim.config.get('soundplayer') == '': def _oss_play(): sndfile = wave.open(path_to_soundfile, 'rb')