Browse Source

Use yaml safe_load where easily possible

Sebastian Lohff 6 years ago
parent
commit
87c9cbddaa
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      question.py
  2. 1
    1
      seopardy.py

+ 1
- 1
question.py View File

@@ -50,7 +50,7 @@ class Questions(object):
50 50
 		# load yaml
51 51
 		ysrc = None
52 52
 		try:
53
-			ysrc = yaml.load(f.read())
53
+			ysrc = yaml.safe_load(f.read())
54 54
 		except Exception as e:
55 55
 			raise QuestionException("Error parsing question file %s: %s" % (self.qfile, e))
56 56
 

+ 1
- 1
seopardy.py View File

@@ -33,7 +33,7 @@ if __name__ == '__main__':
33 33
 	# check and load config file
34 34
 	config = None
35 35
 	try:
36
-		config = yaml.load(open(args.conf))
36
+		config = yaml.safe_load(open(args.conf))
37 37
 	except IOError as e:
38 38
 		print("Error: Could not load config: %s" % (str(e),), file=sys.stderr)
39 39
 		sys.exit(1)

Loading…
Cancel
Save