make sure temp folder hasn't been deleted since creation

This commit is contained in:
Soren I. Bjornstad 2014-06-24 14:50:39 -05:00
parent d659d9cff7
commit 72b4148127

View file

@ -292,7 +292,8 @@ 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"), \
sys.getfilesystemencoding())
if not os.path.exists(_tmpdir): if not os.path.exists(_tmpdir):
os.mkdir(_tmpdir) os.mkdir(_tmpdir)
return _tmpdir return _tmpdir