comparison piecrust/themes/base.py @ 1158:5762a0b821ac

core: Remove yaml deprecation warning.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 11 Jun 2019 16:40:11 -0700
parents 40a40305c4e1
children
comparison
equal deleted inserted replaced
1157:40a40305c4e1 1158:5762a0b821ac
23 # Pre-load the config quickly to see if we're loading a specific 23 # Pre-load the config quickly to see if we're loading a specific
24 # theme from somehwere. 24 # theme from somehwere.
25 # TODO: make configs and themes load together to speed this up. 25 # TODO: make configs and themes load together to speed this up.
26 config_path = os.path.join(self.root_dir, CONFIG_PATH) 26 config_path = os.path.join(self.root_dir, CONFIG_PATH)
27 with open(config_path, 'r', encoding='utf8') as fp: 27 with open(config_path, 'r', encoding='utf8') as fp:
28 config = yaml.load(fp.read()) 28 config = yaml.load(fp.read(), Loader=yaml.SafeLoader)
29 if not config: 29 if not config:
30 return None 30 return None
31 site_config = config.get('site', {}) 31 site_config = config.get('site', {})
32 theme = site_config.get('theme', None) 32 theme = site_config.get('theme', None)
33 if theme is None: 33 if theme is None: