diff options
author | Aaron LI <aly@aaronly.me> | 2020-06-20 18:39:40 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2020-06-20 18:39:40 +0800 |
commit | 4f7f041ee1334c77377f4847a4d285e49156a72b (patch) | |
tree | 763a768e422fef8c2e804e05abaa0b99ec1435a1 | |
parent | 114c2af01697eb0cb8f6f8c26ff5669f4f91d113 (diff) | |
download | resume-4f7f041ee1334c77377f4847a4d285e49156a72b.tar.bz2 |
make-fontawesome5.py: Fix YAML load warning
Use `yaml.safe_load()` instead of `yaml.load()` to fix the following
warning:
YAMLLoadWarning: calling yaml.load() without Loader=... is
deprecated, as the default Loader is unsafe. Please read
https://msg.pyyaml.org/load for full details.
In addition, add a comment that the 'icons.yml' URL that has the '/raw'
part is actually correct, because we need the raw YAML data instead of
the HTML page rendered by Github.
-rwxr-xr-x | fontawesome5/make-fontawesome5.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fontawesome5/make-fontawesome5.py b/fontawesome5/make-fontawesome5.py index 674e074..8143635 100755 --- a/fontawesome5/make-fontawesome5.py +++ b/fontawesome5/make-fontawesome5.py @@ -28,7 +28,7 @@ from datetime import datetime import yaml FA_URL = "https://github.com/FortAwesome/Font-Awesome" -ICONS_URL = FA_URL + "/raw/master/metadata/icons.yml" +ICONS_URL = FA_URL + "/raw/master/metadata/icons.yml" # NOTE: 'raw' is correct ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" # Fonts styles @@ -190,7 +190,7 @@ def main(): data = get_icons_yml() print("Loading icons data ...") - icons = yaml.load(data) + icons = yaml.safe_load(data) icon_list = sorted(icons.keys()) print("Number of icons: %d" % len(icon_list)) |