Skip to content

Commit 641a7de

Browse files
aaryanshuklayuxuanchen1997
authored andcommitted
[libc][newheadergen]: yaml.load instead of safe_load (#100024)
Summary: Co-authored-by: Rose Zhang <[email protected]> Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251226
1 parent 38dd4a8 commit 641a7de

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libc/newhdrgen/yaml_to_classes.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def load_yaml_file(yaml_file, header_class, entry_points):
118118
HeaderFile: An instance of HeaderFile populated with the data.
119119
"""
120120
with open(yaml_file, "r") as f:
121-
yaml_data = yaml.safe_load(f)
121+
yaml_data = yaml.load(f, Loader=yaml.FullLoader)
122122
return yaml_to_classes(yaml_data, header_class, entry_points)
123123

124124

@@ -173,8 +173,7 @@ def add_function_to_yaml(yaml_file, function_details):
173173
new_function = parse_function_details(function_details)
174174

175175
with open(yaml_file, "r") as f:
176-
yaml_data = yaml.safe_load(f)
177-
176+
yaml_data = yaml.load(f, Loader=yaml.FullLoader)
178177
if "functions" not in yaml_data:
179178
yaml_data["functions"] = []
180179

0 commit comments

Comments
 (0)