Skip to content

Commit

Permalink
Fix yaml plugin loading on Python 3.9
Browse files Browse the repository at this point in the history
You get an error trying to run this with Python 3.9 and latest pip
install:
```
$ pptop <PID>                                                                                                                                                                                                               
load() missing 1 required positional argument: 'Loader' 
```

Since the PyYAML library [API changed](yaml/pyyaml#576),
we need to use `safe_load` (which should be the default anyways).
  • Loading branch information
sgnn7 committed Nov 19, 2021
1 parent a2e2720 commit d27ec37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pptop/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit d27ec37

Please sign in to comment.