comparison piecrust/commands/builtin/themes.py @ 1164:727110ea112a

core: Remove more YAML deprecation warnings.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 04 Oct 2019 08:48:07 -0700
parents f13d618cfec6
children
comparison
equal deleted inserted replaced
1163:ed308313bcda 1164:727110ea112a
73 73
74 info_path = os.path.join(theme_dir, THEME_CONFIG_PATH) 74 info_path = os.path.join(theme_dir, THEME_CONFIG_PATH)
75 if os.path.exists(info_path): 75 if os.path.exists(info_path):
76 info = None 76 info = None
77 with open(info_path, 'r', encoding='utf8') as fp: 77 with open(info_path, 'r', encoding='utf8') as fp:
78 theme_cfg = yaml.load(fp.read()) 78 theme_cfg = yaml.safe_load(fp.read())
79 if isinstance(theme_cfg, dict): 79 if isinstance(theme_cfg, dict):
80 info = theme_cfg.get('theme') 80 info = theme_cfg.get('theme')
81 if info: 81 if info:
82 logger.info("Theme info:") 82 logger.info("Theme info:")
83 for k, v in info.items(): 83 for k, v in info.items():