Silence PyYAML warning

Make yaml.load_all() use yaml.SafeLoader to address a warning currently
emitted when bin/tests/system/dnstap/ydump.py is run:

    ydump.py:28: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      for l in yaml.load_all(f.stdout):
This commit is contained in:
Michał Kępień
2020-04-23 08:07:07 +02:00
committed by Ondřej Surý
parent 0bc1b4804e
commit ba0e9cb56c

View File

@@ -25,5 +25,5 @@ DATAFILE = sys.argv[2]
ARGS = [DNSTAP_READ, '-y', DATAFILE]
with subprocess.Popen(ARGS, stdout=subprocess.PIPE) as f:
for l in yaml.load_all(f.stdout):
for l in yaml.load_all(f.stdout, Loader=yaml.SafeLoader):
pprint.pprint(l)