Use yaml safe_load where easily possible
This commit is contained in:
parent
4ce06a2adb
commit
87c9cbddaa
|
@ -50,7 +50,7 @@ class Questions(object):
|
|||
# load yaml
|
||||
ysrc = None
|
||||
try:
|
||||
ysrc = yaml.load(f.read())
|
||||
ysrc = yaml.safe_load(f.read())
|
||||
except Exception as e:
|
||||
raise QuestionException("Error parsing question file %s: %s" % (self.qfile, e))
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ if __name__ == '__main__':
|
|||
# check and load config file
|
||||
config = None
|
||||
try:
|
||||
config = yaml.load(open(args.conf))
|
||||
config = yaml.safe_load(open(args.conf))
|
||||
except IOError as e:
|
||||
print("Error: Could not load config: %s" % (str(e),), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in New Issue