From 518b52060b0fd2d5506f83871a27eec72c44f9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Fri, 23 Jun 2017 15:29:31 +0200 Subject: [PATCH] ReviewBot: add missing yaml import for loading config file. --- ReviewBot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReviewBot.py b/ReviewBot.py index c7def40f..22ddf3af 100644 --- a/ReviewBot.py +++ b/ReviewBot.py @@ -30,6 +30,7 @@ from osclib.comments import CommentAPI from osclib.memoize import memoize import signal import datetime +import yaml try: from xml.etree import cElementTree as ET @@ -88,9 +89,8 @@ class ReviewBot(object): def load_config(self, filename = None): if filename: - fh = open(filename, 'r') - self.config = self._load_config(fh) - close(fh) + with open(filename, 'r') as fh: + self.config = self._load_config(fh) else: self.config = self._load_config()