change out of temp media folder before deleting it

In some cases, not doing so could cause a "this file is being used by
another process" error.
This commit is contained in:
Soren I. Bjornstad 2014-06-28 10:31:12 -05:00
parent 186641ad8c
commit a261f15269

View File

@ -259,6 +259,7 @@ class AnkiPackageExporter(AnkiExporter):
# tidy up intermediate files # tidy up intermediate files
os.unlink(colfile) os.unlink(colfile)
os.unlink(path.replace(".apkg", ".media.db")) os.unlink(path.replace(".apkg", ".media.db"))
os.chdir(self.mediaDir)
shutil.rmtree(path.replace(".apkg", ".media")) shutil.rmtree(path.replace(".apkg", ".media"))
return media return media