Use yaml safe_load where easily possible

This commit is contained in:
Sebastian Lohff 2013-12-03 23:18:30 +01:00
parent 4ce06a2adb
commit 87c9cbddaa
2 changed files with 2 additions and 2 deletions

View File

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

View File

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