Fix permissions error on Windows
This commit is contained in:
parent
fed15f5b90
commit
c6ab8dcc48
@ -149,16 +149,20 @@ def cleanupOldMplayerProcesses():
|
||||
|
||||
exeDir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||
|
||||
for proc in psutil.process_iter(attrs=['pid', 'name', 'exe']):
|
||||
if not proc.info['exe'] or proc.info['name'] != 'mplayer.exe':
|
||||
continue
|
||||
for proc in psutil.process_iter():
|
||||
try:
|
||||
info = proc.as_dict(attrs=['pid', 'name', 'exe'])
|
||||
if not info['exe'] or info['name'] != 'mplayer.exe':
|
||||
continue
|
||||
|
||||
# not anki's bundled mplayer
|
||||
if os.path.dirname(proc.info['exe']) != exeDir:
|
||||
continue
|
||||
# not anki's bundled mplayer
|
||||
if os.path.dirname(info['exe']) != exeDir:
|
||||
continue
|
||||
|
||||
print("terminating old mplayer process...")
|
||||
proc.kill()
|
||||
print("terminating old mplayer process...")
|
||||
proc.kill()
|
||||
except SystemError:
|
||||
pass
|
||||
|
||||
mplayerCmd = ["mplayer", "-really-quiet", "-noautosub"]
|
||||
if isWin:
|
||||
|
Loading…
Reference in New Issue
Block a user