From cdafec02ad4d3300d4f0162e71e98aa6736035aa Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 13 Oct 2016 00:32:28 +0900 Subject: [PATCH] Fix #3038: ``sphinx.ext.math*`` raises TypeError if labels are duplicated --- CHANGES | 1 + sphinx/ext/mathbase.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c905dc0be..e95feb529 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,7 @@ Bugs fixed * #147: Problem with latex chapter style * #3018: LaTeX problem with page layout dimensions and chapter titles * Fix an issue with ``\pysigline`` in LaTeX style file (ref #3023) +* #3038: ``sphinx.ext.math*`` raises TypeError if labels are duplicated Documentation ------------- diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index 57bcb1c0c..ae4b439b7 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -209,7 +209,7 @@ class MathDirective(Directive): self.state.document.note_explicit_target(target) ret.insert(0, target) except UserWarning as exc: - self.state_machine.reporter.warning(exc[0], line=self.lineno) + self.state_machine.reporter.warning(exc.args[0], line=self.lineno) def latex_visit_math(self, node):