#NEWLINE# def make_sure_path_exists( path ) : #NEWLINE# #INDENT# '\n    Ensures that a directory exists.\n\n    :param path: A directory path.\n    ' #NEWLINE# logging . debug ( 'Making sure path exists: {0}' . format ( path ) ) #NEWLINE# try : #NEWLINE# #INDENT# os . makedirs ( path ) #NEWLINE# #UNINDENT# except OSError as exception : #NEWLINE# #INDENT# if ( exception . errno != errno . EEXIST ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# return True