Fixed an issue with the temporary directory not being accessible in windows for some users.
This commit is contained in:
parent
ae1b4c7a87
commit
af763eeb13
1 changed files with 2 additions and 6 deletions
8
utils.py
8
utils.py
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os, zipfile, io, platform
|
import os, zipfile, io, platform
|
||||||
import sys
|
import sys, tempfile
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
|
|
@ -8,11 +8,7 @@ def is_windows():
|
||||||
return platform.system() == 'Windows'
|
return platform.system() == 'Windows'
|
||||||
|
|
||||||
def get_temp_dir():
|
def get_temp_dir():
|
||||||
if is_windows():
|
return tempfile.gettempdir()
|
||||||
temp_dir = os.path.join('c:/','windows','temp')
|
|
||||||
else:
|
|
||||||
temp_dir = os.path.sep+'tmp'
|
|
||||||
return temp_dir
|
|
||||||
|
|
||||||
def log(*args):
|
def log(*args):
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue