From 2944b8194bb5344b2efb47059ec2c71670f16ed4 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 25 Apr 2009 02:38:48 +0900 Subject: [PATCH] if audio player fails to start, give better error --- anki/sound.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/anki/sound.py b/anki/sound.py index e5324338c..1205654d9 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -121,8 +121,11 @@ class QueueMonitor(threading.Thread): time.sleep(0.1) if queue: path = queue.pop(0) - retryWait(subprocess.Popen( - externalPlayer + [path], startupinfo=si)) + try: + retryWait(subprocess.Popen( + externalPlayer + [path], startupinfo=si)) + except OSError: + raise Exception("Audio player not found") else: return