Use yaml safe_load where easily possible

This commit is contained in:
Sebastian Lohff 2013-12-03 23:18:30 +01:00
父節點 4ce06a2adb
當前提交 87c9cbddaa
共有 2 個文件被更改,包括 2 次插入2 次删除

查看文件

@ -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)