path: Close create file right away
This commit is contained in:
parent
40dd539d06
commit
53827aa022
@ -39,12 +39,12 @@ def get_or_create_dir(dir_path):
|
||||
return dir_path
|
||||
|
||||
|
||||
def get_or_create_file(filename):
|
||||
filename = expand_path(filename)
|
||||
if not os.path.isfile(filename):
|
||||
logger.info('Creating file %s', filename)
|
||||
open(filename, 'w')
|
||||
return filename
|
||||
def get_or_create_file(file_path):
|
||||
file_path = expand_path(file_path)
|
||||
if not os.path.isfile(file_path):
|
||||
logger.info('Creating file %s', file_path)
|
||||
open(file_path, 'w').close()
|
||||
return file_path
|
||||
|
||||
|
||||
def path_to_uri(*paths):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user