mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
always change cwd to media dir
This commit is contained in:
parent
1bbffec0d6
commit
84a98550f0
1 changed files with 2 additions and 2 deletions
|
|
@ -3004,8 +3004,6 @@ where key = :key""", key=key, value=value):
|
|||
if dir and not os.path.exists(dir) and create:
|
||||
try:
|
||||
os.mkdir(dir)
|
||||
# change to the current dir
|
||||
os.chdir(dir)
|
||||
except OSError:
|
||||
# permission denied
|
||||
return None
|
||||
|
|
@ -3016,6 +3014,8 @@ where key = :key""", key=key, value=value):
|
|||
dir = self.tmpMediaDir
|
||||
if not dir or not os.path.exists(dir):
|
||||
return None
|
||||
# change to the current dir
|
||||
os.chdir(dir)
|
||||
return dir
|
||||
|
||||
def addMedia(self, path):
|
||||
|
|
|
|||
Loading…
Reference in a new issue