|
From: <mi...@us...> - 2022-12-17 12:17:35
|
Revision: 9310
http://sourceforge.net/p/docutils/code/9310
Author: milde
Date: 2022-12-17 12:17:32 +0000 (Sat, 17 Dec 2022)
Log Message:
-----------
Fix [bugs:#463]. Spurious comma in deprecation warning.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/nodes.py
trunk/docutils/test/test_nodes.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-12-13 21:45:32 UTC (rev 9309)
+++ trunk/docutils/HISTORY.txt 2022-12-17 12:17:32 UTC (rev 9310)
@@ -34,6 +34,7 @@
- Fix `previous_sibling()` method that led to invalid HTML in some cases
(cf. patch #195).
+ - Fix bug #463. Spurious comma in deprecation warning.
* docutils/parsers/recommonmark_wrapper.py
@@ -67,8 +68,8 @@
Changes to the HTML output (no space character before closing tag of
XML declaration, order of metadata elements)
don't affect the HTML semantics, styling, and rendering.
-
- - Wrap definition lists with "details" class argument in a <div>
+
+ - Wrap definition lists with "details" class argument in a <div>
with the "id" and "class" values of the list node.
- Use dpub-ARIA role "doc-footnote" (instead of ARIA role "note")
@@ -4150,7 +4151,7 @@
.. _view_mode: docs/user/config.html#view-mode
-
+
..
Local Variables:
mode: indented-text
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-12-13 21:45:32 UTC (rev 9309)
+++ trunk/docutils/docutils/nodes.py 2022-12-17 12:17:32 UTC (rev 9310)
@@ -1068,7 +1068,7 @@
def set_class(self, name):
"""Add a new class to the "classes" attribute."""
warnings.warn('docutils.nodes.Element.set_class() is deprecated; '
- ' and will be removed in Docutils 0.21 or later.',
+ ' and will be removed in Docutils 0.21 or later.'
"Append to Element['classes'] list attribute directly",
DeprecationWarning, stacklevel=2)
assert ' ' not in name
Modified: trunk/docutils/test/test_nodes.py
===================================================================
--- trunk/docutils/test/test_nodes.py 2022-12-13 21:45:32 UTC (rev 9309)
+++ trunk/docutils/test/test_nodes.py 2022-12-17 12:17:32 UTC (rev 9310)
@@ -352,7 +352,12 @@
node = nodes.Element('Möhren', nodes.Text('Möhren'))
self.assertEqual(str(node), '<Element>Möhren</Element>')
+ def test_set_class_deprecation_warning(self):
+ node = nodes.Element('test node')
+ with self.assertWarns(DeprecationWarning):
+ node.set_class('parrot')
+
class MiscTests(unittest.TestCase):
def test_node_class_names(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|