Merge pull request #966 from mimi1vx/small_fixes

ReviewBot: add missing yaml import for loading config file.
This commit is contained in:
Jimmy Berry 2017-06-23 17:13:19 +02:00 committed by GitHub
commit eba5ff41e8

View File

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