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):