From 2dfa482b2426165394409aad3cbccf27d54651bd Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 30 Jun 2023 18:33:16 +0530 Subject: [PATCH] Update get_config.py --- scripts/get_config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/get_config.py b/scripts/get_config.py index 64ad0d47..0bcc90a1 100644 --- a/scripts/get_config.py +++ b/scripts/get_config.py @@ -16,6 +16,8 @@ parser.add_argument('key', metavar='key', nargs='+', args = parser.parse_args() +config = None + # migrate the old config yaml location config_legacy_yaml = os.path.join(config_directory, "config.yaml") if os.path.isfile(config_legacy_yaml): @@ -29,7 +31,6 @@ if os.path.isfile(config_yaml): config = yaml.load(configfile) except Exception as e: print(e, file=sys.stderr) - config = {} elif os.path.isfile(config_json): import json with open(config_json, 'r') as configfile: @@ -37,8 +38,8 @@ elif os.path.isfile(config_json): config = json.load(configfile) except Exception as e: print(e, file=sys.stderr) - config = {} -else: + +if config is None: config = {} for k in args.key: