Ignore makedirs-command if file in base folder
This commit is contained in:
parent
0ed85e1398
commit
b1b705f28f
1 changed files with 3 additions and 2 deletions
|
|
@ -26,11 +26,12 @@ def save_options(options, path, ignore=None):
|
||||||
|
|
||||||
|
|
||||||
if not os.path.isdir(os.path.dirname(path)):
|
if not os.path.isdir(os.path.dirname(path)):
|
||||||
|
if os.path.dirname(path):
|
||||||
os.makedirs(os.path.dirname(path))
|
os.makedirs(os.path.dirname(path))
|
||||||
|
|
||||||
|
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
json.dump(options_copy,f, skipkeys=True, indent=4)
|
json.dump(options_copy, f, skipkeys=True, indent=4)
|
||||||
|
|
||||||
|
|
||||||
def load_options(path):
|
def load_options(path):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue