mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
don't use communicate(), catch win32 error
This commit is contained in:
parent
e6b207f7af
commit
b079df2a13
1 changed files with 5 additions and 2 deletions
|
@ -183,19 +183,22 @@ def stopMplayer(restart=False):
|
|||
if mplayerManager.mplayer:
|
||||
while 1:
|
||||
try:
|
||||
mplayerManager.mplayer.communicate("quit\n")
|
||||
mplayerManager.mplayer.stdin.write("quit\n")
|
||||
break
|
||||
except OSError, e:
|
||||
if e.errno != errno.EINTR:
|
||||
# osx throws interrupt errors regularly, but we want to
|
||||
# ignore other errors on shutdown
|
||||
break
|
||||
except IOError:
|
||||
# already closed
|
||||
break
|
||||
except ValueError:
|
||||
# already closed
|
||||
break
|
||||
if not restart:
|
||||
mplayerManager.mplayer = -1
|
||||
mplayerCond.notify()
|
||||
mplayerCond.notifyAll()
|
||||
mplayerCond.release()
|
||||
|
||||
def stopMplayerOnce():
|
||||
|
|
Loading…
Reference in a new issue