From 3edb8352b433a332fbbd0622dc052edb787ad0a9 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 16 Jul 2022 02:09:22 +0200 Subject: [PATCH] Support sections with empty bodies in the YAML configuration files. --- platypush/config/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index e9acfec4..481bd275 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -213,11 +213,10 @@ class Config: config['scripts_dir'] = os.path.abspath( os.path.expanduser(file_config[section]) ) - elif ( - 'disabled' not in file_config[section] - or file_config[section]['disabled'] is False - ): - config[section] = file_config[section] + else: + section_config = file_config.get(section, {}) or {} + if not section_config.get('disabled'): + config[section] = section_config return config