miracle2k / webassets

Asset management for Python web development.
BSD 2-Clause "Simplified" License
921 stars 258 forks source link

Use the safe load method in the YAML loader to avoid a warning #525

Closed amercader closed 4 years ago

amercader commented 4 years ago

The YAML loader is currently using the yaml.load() method without defining a loader, which is deprecated and causes a warning to appear:

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  obj = self.yaml.load(f) or {}

This patch updates the call to use yaml.safe_load() which is a shortcut method to use the SafeLoader class.

Fixes #517

miracle2k commented 4 years ago

Thanks.