Skip to content

Commit

Permalink
use safe_load
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Mar 16, 2019
1 parent 43436e7 commit 3f80b24
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions dask/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
import threading
try:
import yaml
from distutils.version import LooseVersion
if yaml.__version__ >= LooseVersion('5.1'):
yaml_load = yaml.safe_load
else:
yaml_load = yaml.load
except ImportError:
yaml = yaml_load = None
yaml = None

from .compatibility import makedirs, builtins, Mapping, string_types

Expand Down Expand Up @@ -170,7 +165,7 @@ def collect_yaml(paths=paths):
for path in file_paths:
try:
with open(path) as f:
data = yaml_load(f.read()) or {}
data = yaml.safe_load(f.read()) or {}
data = normalize_nested_keys(data)
configs.append(data)
except (OSError, IOError):
Expand Down

0 comments on commit 3f80b24

Please sign in to comment.