mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 17:49:01 +00:00
handle fail in tmpdir creation
This commit is contained in:
@@ -102,13 +102,16 @@ def get_tmpdir():
|
|||||||
|
|
||||||
def _get_tmpdir():
|
def _get_tmpdir():
|
||||||
"""create the tmpdir"""
|
"""create the tmpdir"""
|
||||||
if ENV_TEMP in os.environ:
|
try:
|
||||||
t = os.environ[ENV_TEMP]
|
if ENV_TEMP in os.environ:
|
||||||
t = os.path.expanduser(t)
|
t = os.environ[ENV_TEMP]
|
||||||
t = os.path.abspath(t)
|
t = os.path.expanduser(t)
|
||||||
t = os.path.normpath(t)
|
t = os.path.abspath(t)
|
||||||
os.makedirs(t, exist_ok=True)
|
t = os.path.normpath(t)
|
||||||
return t
|
os.makedirs(t, exist_ok=True)
|
||||||
|
return t
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
return tempfile.mkdtemp(prefix='dotdrop-')
|
return tempfile.mkdtemp(prefix='dotdrop-')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user