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
|
# load yaml
|
||||||
ysrc = None
|
ysrc = None
|
||||||
try:
|
try:
|
||||||
ysrc = yaml.load(f.read())
|
ysrc = yaml.safe_load(f.read())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise QuestionException("Error parsing question file %s: %s" % (self.qfile, e))
|
raise QuestionException("Error parsing question file %s: %s" % (self.qfile, e))
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ if __name__ == '__main__':
|
||||||
# check and load config file
|
# check and load config file
|
||||||
config = None
|
config = None
|
||||||
try:
|
try:
|
||||||
config = yaml.load(open(args.conf))
|
config = yaml.safe_load(open(args.conf))
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
print("Error: Could not load config: %s" % (str(e),), file=sys.stderr)
|
print("Error: Could not load config: %s" % (str(e),), file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in New Issue