Skip to content

Commit d35dc1a

Browse files
author
Vladimir Kotal
committed
use yaml.safe_load() to replace deprecated yaml.load()
1 parent 401db1a commit d35dc1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

opengrok-tools/src/main/python/opengrok_tools/utils/readconfig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
#
1919

2020
#
21-
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
21+
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2222
#
2323

2424
import logging
2525
import json
2626
import yaml
2727
import sys
2828

29-
# The following is to make the json parsing work on Python 3.4.
29+
# The following is to make the JSON parsing work on Python 3.4.
3030
try:
3131
from json.decoder import JSONDecodeError
3232
except ImportError:
@@ -58,7 +58,7 @@ def read_config(logger, inputfile):
5858

5959
try:
6060
logger.debug("trying YAML")
61-
cfg = yaml.load(data)
61+
cfg = yaml.safe_load(data)
6262
except AttributeError:
6363
# Not a valid YAML file.
6464
logger.debug("got exception {}".format(sys.exc_info()[0]))

0 commit comments

Comments
 (0)