Skip to content

Commit

Permalink
support/testing/../sample_python_pyyaml_dec.py: unbreak after move to…
Browse files Browse the repository at this point in the history
… pyaml 6.0

Fixes https://gitlab.com/buildroot.org/buildroot/-/jobs/2088684091

python sample_python_pyyaml_dec.py
Traceback (most recent call last):
  File "/root/sample_python_pyyaml_dec.py", line 5, in <module>
    data = yaml.load(serialized)
TypeError: load() missing 1 required positional argument: 'Loader'

yaml.load() requires a loader argument since the move to version 6.0:
yaml/pyyaml#561

The test does not need the extra functionality of load(), so instead move to
the recommended safe_load().

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Tested-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  • Loading branch information
jacmet committed Feb 21, 2022
1 parent f3d0d7e commit a83177a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion support/testing/tests/package/sample_python_pyyaml_dec.py
Expand Up @@ -2,7 +2,7 @@

with open("/tmp/data.yml", "rb") as f:
serialized = f.read()
data = yaml.load(serialized)
data = yaml.safe_load(serialized)
print(data)
assert(data["name"] == "python-pyyaml")
assert(data["versions"] == ["1", "2"])
Expand Down

0 comments on commit a83177a

Please sign in to comment.