Skip to content

Commit

Permalink
Fix yaml 5.1+ support with unsafe loading
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Apr 24, 2019
1 parent 897c86a commit 40fa39e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyspectral/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
from collections import Mapping
import pkg_resources

try:
from yaml import UnsafeLoader
except ImportError:
from yaml import Loader as UnsafeLoader


LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -72,7 +77,7 @@ def get_config():

config = {}
with open(configfile, 'r') as fp_:
config = recursive_dict_update(config, yaml.load(fp_))
config = recursive_dict_update(config, yaml.load(fp_, Loader=UnsafeLoader))

app_dirs = AppDirs('pyspectral', 'pytroll')
user_datadir = app_dirs.user_data_dir
Expand Down

0 comments on commit 40fa39e

Please sign in to comment.