Instantiate Config object simply if confdir not given

This commit is contained in:
Takeshi KOMIYA 2018-03-28 00:54:07 +09:00
parent 181fb1093d
commit 2f1cb1e184

View File

@ -185,10 +185,13 @@ class Sphinx(object):
# read config
self.tags = Tags(tags)
self.config = Config.read(path.join(self.confdir, CONFIG_FILENAME),
confoverrides or {}, self.tags)
self.config.check_unicode()
# defer checking types until i18n has been initialized
if self.confdir is None:
self.config = Config()
else:
self.config = Config.read(path.join(self.confdir, CONFIG_FILENAME),
confoverrides or {}, self.tags)
self.config.check_unicode()
# defer checking types until i18n has been initialized
# initialize some limited config variables before initialize i18n and loading
# extensions