Remove sphinx_config.init_values() manual call

The function signature for Sphinx's config.init_values() changed since
version 1.3. That leads to:

TypeError: init_values() takes exactly 2 arguments (1 given)

But the function is already correctly called from
application.Sphinx()'s constructor. So use the configuration object
from the application instead of creating an own config object.

Change-Id: I343c26560bfe5116d5348b50b1890b3442ed845a
Closes-Bug: #1379998
This commit is contained in:
Thomas Bechtold 2015-06-02 18:40:38 +02:00
parent bb838190ee
commit 1dfe9ef348
1 changed files with 4 additions and 5 deletions

View File

@ -26,7 +26,6 @@ except ImportError:
try:
from sphinx import apidoc
from sphinx import application
from sphinx import config
from sphinx import setup_command
except Exception as e:
# NOTE(dhellmann): During the installation of docutils, setuptools
@ -126,16 +125,16 @@ class LocalBuildDoc(setup_command.BuildDoc):
confoverrides['release'] = self.release
if self.today:
confoverrides['today'] = self.today
sphinx_config = config.Config(self.config_dir, 'conf.py', {}, [])
sphinx_config.init_values()
if self.builder == 'man' and len(sphinx_config.man_pages) == 0:
return
app = application.Sphinx(
self.source_dir, self.config_dir,
self.builder_target_dir, self.doctree_dir,
self.builder, confoverrides, status_stream,
freshenv=self.fresh_env, warningiserror=True)
if self.builder == 'man' and len(app.config.man_pages) == 0:
return
try:
app.build(force_all=self.all_files)
except Exception as err: