Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit 134bdc1

Browse files
committedMay 6, 2019
Use yaml.safe_load to use SafeLoader, instead of FullLoader.
With PyYAML 5.1, `yaml.load` was deprecated, see https://msg.pyyaml.org/load To guard against potential future vulnerabilities, use SafeLoader in this package.
1 parent 0076189 commit 134bdc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎pyraml/parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _handle_load(self, data):
6666
new_relative_path = _calculate_new_relative_path(
6767
self.relative_path, data.file_name)
6868
_included_ctx = ParseContext(
69-
yaml.load(file_content),
69+
yaml.safe_load(file_content),
7070
new_relative_path)
7171
return _included_ctx._handle_load(_included_ctx.data)
7272
return file_content
@@ -175,7 +175,7 @@ def parse(c, relative_path):
175175
first_line, c = c.split('\n', 1)
176176
raml_version = _validate_raml_header(first_line)
177177

178-
context = ParseContext(yaml.load(c), relative_path)
178+
context = ParseContext(yaml.safe_load(c), relative_path)
179179
context.preload_included_resources()
180180

181181
root = RamlRoot(raml_version=raml_version)

0 commit comments

Comments
 (0)
This repository has been archived.