summaryrefslogtreecommitdiff
path: root/sphinx/builders/changes.py
diff options
context:
space:
mode:
authorMartin Packman <martin@zegami.com>2019-03-04 15:58:12 +0000
committerMartin Packman <martin@zegami.com>2019-03-08 13:30:27 +0000
commit71dec3b38e8231125bcc25b3bf6e484df921194f (patch)
tree9be12f0dc8c99a8068531b8d488229eb8435fe29 /sphinx/builders/changes.py
parentbe971c6d385b42524e0660f788abf6399877bc30 (diff)
downloadsphinx-git-71dec3b38e8231125bcc25b3bf6e484df921194f.tar.gz
Fix UnboundLocalError when building changes
Split testing of changes builder to its own test file and root. Improve coverage a little, and add case that fails if a module directive is included in the rst source. Correctly handle changesets with a module declared. Fixes https://github.com/sphinx-doc/sphinx/issues/6134
Diffstat (limited to 'sphinx/builders/changes.py')
-rw-r--r--sphinx/builders/changes.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py
index 308ae9656..aa5fea5a5 100644
--- a/sphinx/builders/changes.py
+++ b/sphinx/builders/changes.py
@@ -85,8 +85,7 @@ class ChangesBuilder(Builder):
entry = '<b>%s</b>: <i>%s</i>.' % (descname, ttext)
apichanges.append((entry, changeset.docname, changeset.lineno))
elif descname or changeset.module:
- if not changeset.module:
- module = _('Builtins')
+ module = changeset.module or _('Builtins')
if not descname:
descname = _('Module level')
if context: