SF.net SVN: docutils:[10194 ] trunk/docutils/docutils/ transforms/references.py
milde--- via Docutils-checkins <[email protected]> Fri, 01 Aug 2025 10:58:54 +0000
| Newsgroups | gmane.text.docutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 10194
http://sourceforge.net/p/docutils/code/10194
Author: milde
Date: 2025-08-01 10:58:54 +0000 (Fri, 01 Aug 2025)
Log Message:
-----------
Fix plural case of an error message.
Don't add the plural "s" if there is only one footnote.
Modified Paths:
--------------
trunk/docutils/docutils/transforms/references.py
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2025-07-31 14:18:24 UTC (rev 10193)
+++ trunk/docutils/docutils/transforms/references.py 2025-08-01 10:58:54 UTC (rev 10194)
@@ -542,10 +542,12 @@
try:
label = self.autofootnote_labels[i]
except IndexError:
+ n = len(self.autofootnote_labels)
+ s = 's' if n > 1 else ''
msg = self.document.reporter.error(
- 'Too many autonumbered footnote references: only %s '
- 'corresponding footnotes available.'
- % len(self.autofootnote_labels), base_node=ref)
+ 'Too many autonumbered footnote references: '
+ f'only {n} corresponding footnote{s} available.',
+ base_node=ref)
msgid = self.document.set_id(msg)
for ref in self.document.autofootnote_refs[i:]:
if ref.resolved or ref.hasattr('refname'):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.