Ensuring the temp dir exists before returning it

This commit is contained in:
Strahinja Val Markovic 2013-10-06 18:27:47 -07:00
parent f0c9878f87
commit 1bba4a38cc

View File

@ -38,7 +38,10 @@ def ToUtf8IfNeeded( string_or_unicode ):
def PathToTempDir(): def PathToTempDir():
return os.path.join( tempfile.gettempdir(), 'ycm_temp' ) tempdir = os.path.join( tempfile.gettempdir(), 'ycm_temp' )
if not os.path.exists( tempdir ):
os.makedirs( tempdir )
return tempdir
# From here: http://stackoverflow.com/a/8536476/1672783 # From here: http://stackoverflow.com/a/8536476/1672783