From 87c9cbddaa3a726528733981c1defdeafe83f24b Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Tue, 3 Dec 2013 23:18:30 +0100 Subject: [PATCH] Use yaml safe_load where easily possible --- question.py | 2 +- seopardy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/question.py b/question.py index 2377ee4..4d082a1 100644 --- a/question.py +++ b/question.py @@ -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)) diff --git a/seopardy.py b/seopardy.py index 941378a..49d25ff 100755 --- a/seopardy.py +++ b/seopardy.py @@ -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)