From e66e66c614c82658c461a3975b647bd238ca11c3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 15 Jun 2009 11:37:02 +0900 Subject: [PATCH] don't catch all osx errors --- anki/sound.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/anki/sound.py b/anki/sound.py index a30ddac40..502326041 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -8,7 +8,7 @@ Sound support """ __docformat__ = 'restructuredtext' -import re, sys, threading, time, subprocess, os, signal, atexit +import re, sys, threading, time, subprocess, os, signal, atexit, errno # Shared utils ########################################################################## @@ -171,9 +171,11 @@ def stopMplayer(): try: mplayerManager.mplayer.communicate("quit\n") break - except OSError: - # osx throws these regularly - pass + except OSError, e: + if e.errno != errno.EINTR: + # osx throws interrupt errors regularly, but we want to + # ignore other errors on shutdown + break mplayerManager.mplayer = -1 mplayerCond.notify() mplayerCond.release()