From d27ec374c6c6dd1568297731b8ff32f077b2b384 Mon Sep 17 00:00:00 2001 From: Srdjan Grubor Date: Fri, 19 Nov 2021 10:47:30 -0600 Subject: [PATCH] Fix yaml plugin loading on Python 3.9 You get an error trying to run this with Python 3.9 and latest pip install: ``` $ pptop load() missing 1 required positional argument: 'Loader' ``` Since the PyYAML library [API changed](https://github.com/yaml/pyyaml/issues/576), we need to use `safe_load` (which should be the default anyways). --- pptop/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pptop/core.py b/pptop/core.py index 1fba9ba..14db73e 100644 --- a/pptop/core.py +++ b/pptop/core.py @@ -1318,7 +1318,7 @@ def format_plugin_option(dct, o, v): if not os.path.isdir(_d.pptop_dir + '/lib'): os.mkdir(_d.pptop_dir + '/lib') with open(config_file) as fh: - config.update(yaml.load(fh.read())) + config.update(yaml.safe_load(fh.read())) console = config.get('console') if console is None: console = {}