1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 22:33:03 +00:00

handle fail in tmpdir creation

This commit is contained in:
deadc0de6
2020-11-04 09:24:35 +01:00
parent aa14fb15fa
commit 6d0f42f1f9

View File

@@ -102,13 +102,16 @@ def get_tmpdir():
def _get_tmpdir():
"""create the tmpdir"""
if ENV_TEMP in os.environ:
t = os.environ[ENV_TEMP]
t = os.path.expanduser(t)
t = os.path.abspath(t)
t = os.path.normpath(t)
os.makedirs(t, exist_ok=True)
return t
try:
if ENV_TEMP in os.environ:
t = os.environ[ENV_TEMP]
t = os.path.expanduser(t)
t = os.path.abspath(t)
t = os.path.normpath(t)
os.makedirs(t, exist_ok=True)
return t
except Exception:
pass
return tempfile.mkdtemp(prefix='dotdrop-')