mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
make sure temp folder hasn't been deleted since creation
This commit is contained in:
parent
d659d9cff7
commit
72b4148127
1 changed files with 4 additions and 3 deletions
|
@ -292,9 +292,10 @@ def tmpdir():
|
||||||
shutil.rmtree(_tmpdir)
|
shutil.rmtree(_tmpdir)
|
||||||
import atexit
|
import atexit
|
||||||
atexit.register(cleanup)
|
atexit.register(cleanup)
|
||||||
_tmpdir = unicode(os.path.join(tempfile.gettempdir(), "anki_temp"), sys.getfilesystemencoding())
|
_tmpdir = unicode(os.path.join(tempfile.gettempdir(), "anki_temp"), \
|
||||||
if not os.path.exists(_tmpdir):
|
sys.getfilesystemencoding())
|
||||||
os.mkdir(_tmpdir)
|
if not os.path.exists(_tmpdir):
|
||||||
|
os.mkdir(_tmpdir)
|
||||||
return _tmpdir
|
return _tmpdir
|
||||||
|
|
||||||
def tmpfile(prefix="", suffix=""):
|
def tmpfile(prefix="", suffix=""):
|
||||||
|
|
Loading…
Reference in a new issue