From 868949908c82cf6fe4e714f4162b50a8733d01c4 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Thu, 10 Feb 2022 14:45:36 +0000 Subject: [PATCH] Use `yaml.safe_load` in `check-swagger-sources.py` (#3719) --- scripts/check-swagger-sources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check-swagger-sources.py b/scripts/check-swagger-sources.py index df99b7c0..39e27f24 100755 --- a/scripts/check-swagger-sources.py +++ b/scripts/check-swagger-sources.py @@ -89,7 +89,7 @@ def check_response(filepath, request, code, response): def check_swagger_file(filepath): with open(filepath) as f: - swagger = yaml.load(f) + swagger = yaml.safe_load(f) for path, path_api in swagger.get('paths', {}).items(): @@ -162,7 +162,7 @@ def load_file(path): else: # We have to assume it's YAML because some of the YAML examples # do not have file extensions. - return yaml.load(f) + return yaml.safe_load(f) if __name__ == '__main__':