Skip to content

Commit d57cee6

Browse files
author
Thomas Preud'homme
committed
Update pyyaml to fix build failure with Python 3.9
Upgrade pyyaml to the latest bugfix release for the next stable version: 5.1.2. This fixes a build failure when Python is 3.9. This requires migrating to yaml.safe_load to avoid warnings due to the use of unsafe load() method. Reviewed By: tnfchris Differential Revision: https://reviews.llvm.org/D109226
1 parent 09fd15b commit d57cee6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lnt/lnttool/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def dict(self):
5050

5151
def _try_load_config(self, filename):
5252
try:
53-
config = yaml.load(open(filename))
53+
config = yaml.safe_load(open(filename))
5454
for key, value in config.items():
5555
self._set(key, value)
5656
except IOError as e:

lnt/server/db/v4db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class V4DB(object):
1919
def _load_schema_file(self, schema_file):
2020
session = self.make_session(expire_on_commit=False)
2121
with open(schema_file) as schema_fd:
22-
data = yaml.load(schema_fd)
22+
data = yaml.safe_load(schema_fd)
2323
suite = testsuite.TestSuite.from_json(data)
2424
testsuite.check_testsuite_schema_changes(session, suite)
2525
suite = testsuite.sync_testsuite_with_metatables(session, suite)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"Flask-WTF==0.12",
131131
"typing",
132132
"click==6.7",
133-
"pyyaml==3.13",
133+
"pyyaml==5.1.2",
134134
"requests",
135135
"future",
136136
"lit==0.11.1",

tests/server/ui/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_schema(self):
278278

279279
# The reported schema should be the same as the yaml one on the top.
280280
with open('%s/schemas/nts.yaml' % self.instance_path) as syaml:
281-
yaml_schema = yaml.load(syaml)
281+
yaml_schema = yaml.safe_load(syaml)
282282
# Do some massaging to make it similar to the rest API result.
283283
for m in yaml_schema['metrics']:
284284
if 'unit' not in m:

0 commit comments

Comments
 (0)