fix for Open Addons Folder... failing on windows

This commit is contained in:
mikem 2012-01-19 05:00:16 +09:00
parent ad5be96468
commit 8a78de45c1

View file

@ -2,7 +2,7 @@
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import * from aqt.qt import *
import re, os, sys, urllib, time import re, os, sys, urllib, time, subprocess
import aqt import aqt
from anki.sound import playFromText, stripSounds from anki.sound import playFromText, stripSounds
from anki.utils import call, isWin, isMac from anki.utils import call, isWin, isMac
@ -329,7 +329,7 @@ def openFolder(path):
if isWin: if isWin:
if isinstance(path, unicode): if isinstance(path, unicode):
path = path.encode(sys.getfilesystemencoding()) path = path.encode(sys.getfilesystemencoding())
call(["explorer", path], wait=False) subprocess.Popen(["explorer", path])
else: else:
QDesktopServices.openUrl(QUrl("file://" + path)) QDesktopServices.openUrl(QUrl("file://" + path))