Skip to content

Commit ba0744e

Browse files
[libc][newheadergen]: yaml.load instead of safe_load (#100024)
Co-authored-by: Rose Zhang <[email protected]>
1 parent 624d322 commit ba0744e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libc/newhdrgen/yaml_to_classes.py

Lines changed: 2 additions & 3 deletions
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)