Issue reshuffled config file path and filename check location in __load_or_create method for clarity
@@ -52,9 +52,6 @@ class NiftyNetGlobalConfig(object):
}
backup = False
- config_dir, config_filename = split(config_file)
- if not isdir(config_dir):
- makedirs(config_dir)
if isfile(config_file):
try:
config = ConfigParser()
@@ -81,6 +78,10 @@ class NiftyNetGlobalConfig(object):
# config options: so return
return dict(config)
+ config_dir, config_filename = split(config_file)
+ if not isdir(config_dir):
+ makedirs(config_dir)
+
if backup: # config file exists, but does not contain all required
# config opts: so backup not to override
timestamp = strftime('%Y-%m-%d-%H-%M-%S')
