Skip to content

Commit

Permalink
Don't raise exception on missing man pages
Browse files Browse the repository at this point in the history
The revert in Ia6cfbfe5b10a5b714fbb9f21ca61380aaf231638 actually
broke Sphinx 1.3.x support again. Try to fix it for real this
time by avoiding an exception on missing man_pages.

NOTE(dmllr): don't change dict while iterating over it, hopefully
this fixes the gating failure with python 3.5.x

Change-Id: I52d45fa0a0d42de690d3a492068f7bb03483a224
Related-Bug: 1379998
  • Loading branch information
dirkmueller committed Jan 2, 2017
1 parent adb301f commit 9fd7aa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pbr/builddoc.py
Expand Up @@ -141,7 +141,8 @@ def _sphinx_run(self, warnerrors):
sphinx_config.init_values(warnings.warn)
else:
sphinx_config.init_values()
if self.builder == 'man' and len(sphinx_config.man_pages) == 0:
if self.builder == 'man' and len(
getattr(sphinx_config, 'man_pages', '')) == 0:
return
if self.sphinx_initialized:
if sphinx_ver >= pkg_resources.parse_version('1.4.2'):
Expand Down
6 changes: 3 additions & 3 deletions pbr/util.py
Expand Up @@ -213,9 +213,9 @@ def cfg_to_args(path='setup.cfg', script_args=()):
parser.read(path)
config = {}
for section in parser.sections():
config[section] = dict(parser.items(section))
for k in config[section]:
config[section][k.replace('-', '_')] = config[section].pop(k)
config[section] = dict()
for k, value in parser.items(section):
config[section][k.replace('-', '_')] = value

# Run setup_hooks, if configured
setup_hooks = has_get_option(config, 'global', 'setup_hooks')
Expand Down

0 comments on commit 9fd7aa2

Please sign in to comment.