From b1b705f28f7d3b888f6e8bf1995ec429bef38ebb Mon Sep 17 00:00:00 2001 From: rasmusvt Date: Thu, 7 Jul 2022 13:07:22 +0200 Subject: [PATCH] Ignore makedirs-command if file in base folder --- nafuma/auxillary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nafuma/auxillary.py b/nafuma/auxillary.py index 45633c5..a63c8fc 100644 --- a/nafuma/auxillary.py +++ b/nafuma/auxillary.py @@ -26,11 +26,12 @@ def save_options(options, path, ignore=None): if not os.path.isdir(os.path.dirname(path)): - os.makedirs(os.path.dirname(path)) + if os.path.dirname(path): + os.makedirs(os.path.dirname(path)) 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):