Skip to content

Fix yaml warning

Arun Persaud requested to merge arunpersaud/pysrim:fix_yaml_warning into master

see https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

the yaml.SafeLoader option seems to be the best choice here.

Quick way to test:

import srim
dbpath = os.path.join(srim.__path__[0], 'data', 'elements.yaml')
a = yaml.load(open(dbpath, "r"), Loader=yaml.SafeLoader) 
b = yaml.load(open(dbpath, "r")) 
a == b

Merge request reports