8000 Use yaml.safe_load instead of load (#6719) · coderanger/django-rest-framework@62ed1f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 62ed1f8

Browse files
rhcarvalhorpkilby
authored andcommitted
Use yaml.safe_load instead of load (encode#6719)
Use of PyYAML's yaml.load function without specifying the Loader parameter has been deprecated, see https://msg.pyyaml.org/load. Earlier versions of PyYAML already had the alternative safe_load function, which limits the loader to a subset of YAML constructs, that is enough for what we need here. Fixes encode#6677
1 parent 063f0de commit 62ed1f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/schemas/test_managementcommand.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_renders_default_schema_with_custom_title_url_and_description(self):
4545
'--description=Sample description',
4646
stdout=self.out)
4747
# Check valid YAML was output.
48-
schema = yaml.load(self.out.getvalue())
48+
schema = yaml.safe_load(self.out.getvalue())
4949
assert schema['openapi'] == '3.0.2'
5050

5151
def test_renders_openapi_json_schema(self):

0 commit comments

Comments
 (0)
0