diff options
author | Dirk Mueller <dirk@dmllr.de> | 2016-12-21 23:29:52 +0100 |
---|---|---|
committer | Dirk Mueller <dirk@dmllr.de> | 2017-01-02 23:08:30 +0100 |
commit | 9fd7aa2cc7fe50f68bd9c86c3db7a8f7ae710c05 (patch) | |
tree | 2faf2e3f55c10223126ba526e35de04d21d9ede1 | |
parent | adb301fe2c39834a3dd4ceba5ae4a4ba57d988db (diff) | |
download | pbr-9fd7aa2cc7fe50f68bd9c86c3db7a8f7ae710c05.tar.gz |
Don't raise exception on missing man pages
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
-rw-r--r-- | pbr/builddoc.py | 3 | ||||
-rw-r--r-- | pbr/util.py | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/pbr/builddoc.py b/pbr/builddoc.py index 605066e..c267af2 100644 --- a/pbr/builddoc.py +++ b/pbr/builddoc.py @@ -141,7 +141,8 @@ class LocalBuildDoc(setup_command.BuildDoc): 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'): diff --git a/pbr/util.py b/pbr/util.py index 47ba703..22f83b6 100644 --- a/pbr/util.py +++ b/pbr/util.py @@ -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') |